Parenting is and always was a difficult job. Though most parents develop their own methods by trial, there are certain guidelines that one must follow.
A child of any age requires independence to try out his new skills and also has a need for limits beyond which he cannot venture.
Set clear and easily understood limits for his/her behavior.
Be consistent in what you expect from him so that he realizes that no means no and he cannot get his way by wheedling or throwing tantrums. Praise him for good behavior. This is more effective than reprimands for behaving badly.
Do not shout at him or beat him for bad behavior. Show your disapproval by saying so sternly.
Never call him a bad boy if he has done something bad. Just tell him that you did not like that particular act of his and it will make you happy if he does not repeat it.