To stop a child from disobeying you,
warn them that after you count to three, you'll put them into time out. Then count and follow through if they don't stop.
warn them that after you count to three, you'll slap them.  Then count and follow through if they don't stop.