It does not mean punish the child; to discipline is to teach.
Children misbehave not because they want to. They do so because they don’t have the mental capability to behave well all the time.
Ironically, a child’s misbehaviour shows that they feel safe around you and that they trust you.
As a parent, it’s your role to know why your child is behaving badly. The key is to identify their current emotional state. Ask yourself the why, what and how questions.
Why does the child feel or act this way?
What lesson do you want to teach the child at this moment?
How do you want to teach this lesson?