Four-year-old Pedro sits on the floor watching his mother puttering away on her laptop. Suddenly, Pedro picks up the box of cars he’s playing with and dumps it on the floor.

Three-year-old Beth is playing on the playground, and her father is looking at his watch. “One more minute until it’s time to go home!” he calls. Beth replies, “Okay, Daddy.” One minute later, she completely ignores her father’s calls to come home and runs the other  direction.

Six-year-old Robby wants to pour his own glass of milk. “That’s a grown-up job,” his mother says, and pours it herself. Robby knocks her hand on purpose, and the milk splatters.

Sometimes it seems like parenting is just a journey from one misbehavior to another. According to Dr. Laura Markham, clinical psychologist and author of Peaceful Parent, Happy Kids: How to Stop Yelling and Start Connecting, parents who view their child’s actions as wanton misbehavior are missing the point.

“Everything children do is an attempt to meet legitimate needs or express legitimate feelings,” she says. “Of course, not everything they want to do can be permitted. But the feelings and needs are always legitimate. Even if a child is actually trying to misbehave—for instance, when she looks right at you and dumps her cereal on the floor—that is a cry for help.” Seeing past the misbehavior to the emotional cause will help you address the misbehavior at the source, and also figure out if something you’re doing is contributing to your child’s poor reaction. So what could your kid be trying to communicate?

I Need Attention!

Sometimes, when you can tell that your child is misbehaving to get attention, your knee-jerk reaction might be to give her less attention. After all, you don’t want to reinforce the misbehavior, right?

How to respond: According to Markham, you should do the opposite. “If a child is misbehaving to get attention, then he clearly is not getting enough attention,” she explains. “Consider a parallel: if your child is acting up because he’s hungry, you don’t withhold food. You feed him. If your child is acting up because he is feeling disconnected from you, then you reconnect with him.”

Markham also suggests committing to a twenty-minute “special time” with each child, each day. That twenty minutes may be hard to squeeze out of your busy schedule, but it’ll fulfill your child’s need for attention before it becomes a behavior issue.

What Are You Gonna Do About It? 

Sometimes your child tests the rules to see what your reaction will be.  Kids are still trying to figure out how the world works, explains Markham. So if you tell her, “It’s time to go,” she’ll want to know whether you really mean it, and what you’ll do if she refuses.

How to respond: Keep your cool, stick to the rules that you laid out, and try your best not to turn the situation into a power struggle. Empathize with your child, and let her know you’re on her side, but consistently follow through with the boundaries you've set. When those boundaries are clear, she'll know what to expect from you, and won't act out just to see how you'll react.

I Feel Yucky 

When your child is under the weather, he can be more prone to acting out. Children have even less ability to cope with illness than adults do. That might mean potty training regressions, tantrums, increased aggression, or refusal to do anything difficult.

How to respond: What your child needs most when he’s sick is understanding and compassion. Give him extra help getting dressed in the morning or cleaning up his toys. Let minor infractions slide. When you can’t ignore an incident, like hitting his little sister, show that you understand why he’s having such a hard time: “You know to use your words, but it just seems so much harder today because you’re sick. Let’s think of something we can do to make your sister happier now.”

I Can Do It Myself

Kids can get frustrated and misbehave when they can’t or aren’t allowed to do something on their own. The drive for independence is a healthy, legitimate need, according to Markham, and one that parents should expect.

How to respond: “If parents want a kid who will eventually become responsible, then they need to respect their child’s moves toward independence, and to guide the child safely without squashing that urge,” says Markham. For example, let her pour from an almost-empty milk carton into a large cup while you spot her. Or, give her independence in other areas, such as letting her run ahead to the end of the block instead of holding your hand. Either way, let her know that you recognize and respect how much she can do, and that you will help her learn to do even more.

I’m Bad Anyway, So What Does It Matter?

When a child feels bad about herself, she often misbehaves. “They feel bad inside, so they act bad outside,” says Markham.

How to respond: Watch out for this. It’s easy to get aggravated when a child snowballs from doing something slightly wrong to doing something much worse after she gets yelled at. Prevent this by disciplining your child gently and showing her how much you love her on a regular basis. Point out and praise the good things that your child does. When she feels valued, she’ll act like a valued person.

I Just Can’t Help It!

Because they’re still developing, young children just don’t have the same impulse control as adults do. Even if your child knows he shouldn’t do something like hit his sister, when he gets upset at her, he may not have the self-awareness to recognize that it’s not okay in time to stop himself. He might feel like there’s no other way that he could have reacted.

How to respond: There’s no instant solution. When his behavior seems to be a result of him just not being able to control himself, pause and talk with him about other ways he could have behaved and should behave in the future Suggest a better way to handle his emotions, like stomping his foot, yelling “no,” taking some time to cool off, or finding an adult to help him. Over time, this will help him build his impulse control.

Kids’ ways of lashing out can sometimes leave parents shaking their heads in confusion and frustration. As with adults, even if the behavior is misguided, the feelings behind it are valid. Figuring out what those feelings are and what causes them to boil over will help you direct and comfort your child in a way that encourages his self-control and gives him the support he needs to manage his emotions.