We don’t use corporal punishment but found taking away privileges, not giving attention to bad behaviours plus when they were toddlers I’d actually pretend to leave the supermarket when they had tantrums (was hiding in other aisle)…they’d quickly stop screaming and look for me.
Sometimes small children have to be physically removed from danger or given a hand slap if they’re going to touch something dangerous. My own opinion which some might disagree with is that some boys do benefit from corporal punishment, girls rarely do, also the situation will be different depending on the child’s personality.