Time outs and spankings if time outs don't work. Time outs work with most kids, but the more challenging children may require you to repeatedly return them to the time out. Just stick with it and eventually most children comply. One minute per year of age is an appropriate length of time. Spanking is a last resort and should never be done in anger or with yelling.
We do time outs. She hates being in a room where there is no one else to talk to. I also set a timer since they have no sense of time. She knows when the buzzer goes off, she can get up and I don't have to field 100 "can I get up".
Once she is allowed to get up, I get down eye to eye and tell her why she was there, give hugs and kisses.
I sit my daughter down in a corner for 5 minutes and if she continues the bad behavior then I spank her hands and if that doesn't work then I send her to bed early without dessert and without watching cartoons.