Don't just wait until they repeat their negative habits and then punish them for it. It won't work. When you come up against unacceptable behavior, stop right there and explain how you expect things to be different. If you are angry or frustrated, you are wasting your time. You must maintain your dignity and cool.
Smiles make everything go down better.
After explaining how things are going to be different, put the kid through his paces. Walk him through the right response or action. If it seems appropriate, have him repeat the same act of obedience several times as a way to program his mind. Fourth, stop thinking of the rod as something to be used at the end of an intolerance curve. Parents too often make such a big deal out of spanking their kids.