It's not about punishment, It's about learning.
There isn't one right way to get children to behave themselves. Your child's temperament, your parenting style and the situation will all influence the methods you use.
A quiet, timid child may need only gentle guidance, for example. A more defiant, stubborn child who hates being controlled will probably be more of a challenge, and if you have a similar nature it could be a recipe for conflict.
Teach by example. Children learn a lot about how to behave and cope with situations by copying adults, and that usually means you. If you don't want your child to behave aggressively, don't let him see you behaving that way either.
Child-proof your home. Put valuable, breakable and dangerous objects (and, therefore, temptation) out of your child's reach.
Keep your sense of humour. Make an effort to be positive and to try to see the funny side of your child's behaviour, if appropriate.
Handle stress. If you feel under pressure or there are a lot of other stresses in your life, it can seem harder to cope with a demanding child. It's important to take some time for yourself and work at ways of keeping stress to a minimum.