Young children need to be disciplined well. Its hard to reason with a 2 or 3 year old. Some kids do need a deterrent. So the occassional smack (below the knees) is OK. Once they realise that there is cause & effect even the threat of a smack does the trick.

The older they get, they learn whats right & wrong. Then parents can guide them making right judgements.