I only spanked my children when they did something dangerous and they were too young to reason with.
For example, early one morning I woke up to the sound of water running. I quickly got and went to investigate, saw that water was flowiing out from the bathroom. I went in and found that my second son (the intellectually disabled one) was in the bath with both taps turned on. After pulling him out of the bath and turning the taps off I slapped him hard three or four times on the back of the legs as he could have drowned or scalded himself.
When the children were older I tended to make them stand in the corner if they misbehaved. i even did it once in a cafe when my eldest son played up and a couple of other diners and the cafe owner thanked me for it.
PS - I didn't vote because I think that spanking is very occasionally a valid frm of punishment but generally speaking it isn't.