A parent's first reaction to their child misbehaving is often to shout or punish them, simply out of frustration and not knowing what other action to take. This is quite a normal reaction and for some children, it is an effective solution, but not when used in excess.
On the other hand, if you threaten punishment for continual disruptive behaviour, but never follow through, the child will quickly learn it is an empty threat and take no notice, making their behaviour worse.
There are better ways to deal with your child's behaviour issues and even redirect their behaviour and help them make the right choices.
The most important piece of information you need to know when your child is misbehaving is to stay calm. By staying calm, you are keeping yourself in control of the situation and thinking more rationally. Lowering the tone and level of your voice when you speak to them about something they have done wrong, will help you to remain calm. Even if you are so angry with them you feel like you just want to scream, speaking in a slow calm voice is an effective way to relax your whole body.
Just remember... when you are clam, you remain in control of the situation.
Children often act out as a way of gaining attention. Many children can not differentiate between positive and negative attention. To them, any attention, even being shouted at by Mum or Dad, is better than no attention at all.
What you need to show your child is that their misbehaving will in fact gain them no attention at all, while their good behaviour will gain them extra. Praise your child with words and actions every single time they do something great.
Make a big deal about it and let them know how happy you are with them.
All children thrive on praise.
On the other hand, as best you can, ignore negative behaviour. Do not let them think that by misbehaving they will get your attention. In some cases, you will need to acknowledge that they have done the wrong thing, but this needs to be done as calmly as possible, with as little interaction as possible. They need to learn that the way to get you to pay lots of attention to them, is by making the right choices.