Parakeets have brains half the size of a peanut. They are not intelligent enough to respond to discipline, which is negative. Try something positive to train them to behave in the way you would like. There are numerous books on the subject.
Do not punish the bird. It does not know any better and it cannot learn. That is cruelty to animals.