Rules About Hitting Children and Talmidim
1) One is forbidden to hit children when angry (which usually happens). "An angry person is compared to one who worships avodoh zorah."
2) We are also forbidden to hit children if done with cruelty, even if we are not angry.
3) The above is true also if a person hits a child or talmid who has done something wrong. Hitting children unjustifiably causes immense harm to their Torah education.
4) When a child is acting wildly and disrupts the class we must look for ways to restrain him. When no other way helps we should hit him with love and not with hatred. We should surely not hit him cruelly. Only on condition that the father or educator can control himself and is not at all angry is he allowed to punish in such a way.
5) We must hit the child in a place on his body where he will definitely not be harmed and it should be done with rachamim. I heard from an educator that he would wait five minutes before hitting a child so that he would be convinced he was not angry. The smallest mixture of anger forbids hitting a child.
In conclusion, a father and teacher must give the child the feeling that he loves him and is concerned only with his good (and not concerned with cooling down his personal anger, etc.). The child must be convinced that he has truly acted out of line so that even if severely punished he will accept it with understanding and justify it. He will only love his father and teacher more because of it.
This is what the posuk means "Someone who spares his rod hates his son, but he who loves him . . . (Mishlei 13:24)." Hitting a child while feeling real love for him is called proper disciplining through corporal punishment.