Halloween can be a spooky time for some children. But, a little good-natured fear might actually be good for them.

Fear helps us learn how to avoid a situation. The emotion is triggered in deeper parts of our brain and regulated by our thinking systems in the front of our brain.

Sometimes we understand what makes us scared, and sometimes we don’t. When we — both adults and kids — don’t understand why we’re afraid, our reactions can be more primal or instinctual. That is, we sometimes unconsciously learn to avoid things because of fear.

Have you ever seen a cat get scared by a shadow? That’s an unconscious reaction, and it happens when we don’t have the frontal thinking pathways of the brain—our “control balance”—to calm us down.

Now, here’s why fear can be good for your kids: It teaches them to avoid things that can cause them harm. If Bobby is afraid of a loud noise, he won’t go near it. If he is afraid of cars that are driving fast, he won’t cross the street by himself.

As children are exposed to scary things, they begin to better develop the control systems of their brain to regulate that unconscious reaction. They do this by learning to use their thinking system in the front of their brain to balance or work through the emotion.

Let’s say that Bobby saw a friend fall of his bike and get hurt, and now Bobby is afraid to ride. Bobby’s parents can show him how to ride without falling, and can encourage him to practice riding without falling. Over time, as Bobby rides his bike without falling, his fear will be replaced by the happiness he feels when he rides. In this example, Bobby learned that something that caused him fear wasn’t scary once he tried it. This is an excellent coping skill.

Unfortunately, fear can also be bad for kids. If kids experience too much fear or don’t feel safe when they experience fear, they won’t be able to learn good coping skills. In the example above, if Bobby didn’t believe that his parents would help him when he was scared or had trouble, his fear might not go away. Instead, he may simply avoid riding a bike.

That feeling of safety is especially important when kids are younger, as they are limited in their ability to think through their emotions. The feeling of fear is so strong that it gets in the way of their ability to use their thinking balance. And because fear can lead to avoidance, this is the time when kids often begin to develop irrational fears and phobias.

So, how can you help kids learn to balance fear during the Halloween season? Here are some simple tips:

Talk about good fear and bad fear. Make sure your children know when to listen to the scary feeling. At times, fear will tell them they’re in danger. At other times, they will need to work through the feeling to learn healthier ways to react.

Make sure your child feels safe. This provides a safety net for them to work through the scary feelings.

Remember that young kids feel all emotions, especially fear, very strongly due to the immaturity of their brains. Because the same part of the brain is used to control emotions and make decisions, it’s really hard for kids to do both at the same time. Younger children won’t be able to think while feeling scared. Take a minute to hug them until they calm down, or give them a minute to take some deep breaths. Then talk to them about what was scary.

Model good coping strategies. Talk to your kids about things that make you scared and how you work through those feelings to teach yourself not to be afraid.

Fear is unavoidable, it’s natural, and sometimes it’s a good thing. But it’s how we cope with it that makes the difference. Kids can use fear to learn to manage emotions and build the front of their brains so that they have a strong thinking balance.

Sarah Levin Allen, Ph.D., CBIS, is an assistant professor in the Philadelphia College of Osteopathic Medicine’s Department of Psychology and a member of the Inquirer’s health advisory panel. Kevin Charan is a master’s student in PCOM’s Neuro-behavioral Track of the Biomedical Sciences Master’s Program.