The answer depends on the child.
Hitting a child is simply not acceptable.
Punishments must vary depending on the reason, and the child.
My youngest was such a sensitive soul that a sideways look would send her into floods of tears. her biggest punishment was always simply to let her know she had displeased her mum and I - that was more than enough, she would cry and apologise, and (usually) improve forthwith.
Her oldest sister was a total nightmare, and we had to use segretated eating at home, grounding, (there were no bedroom TV's or phones to be removed in those days!) and endless reasoning talks that often descended into shouting matches.
It is a difficult path to adulthood, some make it easier for themsevles, and others around them, than others, but they usually get there intact.
More than concentrating on bad behaviour, parents need to heap on the praise for good behaviour, which often goes as 'the way it should be', but we all respond to appreciation and being made to feel good about ourselves, what ever age we are.