Even if his servants isn’t listening to him, it is prohibited to hit him [the servant]. But it is permissible to hit his children who are minors or an orphan that he is raising in his home in order to teach them the straight path, for this is for their best
One must be careful not to throw broken glass or the like in a place where they would be likely to injure.
If his neighbor has a head illness [migraine?], heaven forbid, and the sound of the banging would harm him, one may not pound medicines and the like even in his house. Anything that the sound of pounding them would reach his neighbors home and harm him.
The halakhah in sei’f 2 implies a requirement to study parenting techniques. Hitting a child is only permissible when it is in their best interest. One has to therefore take all efforts to know when that is.