The tossing and turning in bed and bouts of screaming in the middle of the night can plague your sleep. Whether you’re dreaming about being fired at work or being chased by some mythical creature, these nightmares can actually help your health. In the video, “The Good Side of Bad Dreams,” The Science of Us Sleep Institute explains there is a bright side to dark dreams; they allow the unconscious mind to communicate with the conscious to help us resolve hidden problems in our lives that appear as symbols in nightmares.

Approximately 50 percent to 85 percent of adults report having at least an occasional nightmare, says the American Academy of Sleep Medicine, while about 75 percent of children can remember having at least one nightmare during childhood. Most people have the occasional nightmare, especially during times of stress. These nightmares tend to reflect the things that concern us the most while we’re awake and continue to bother us when we sleep, according to The Science of Us.

A 2009 study published in the journal Current Directions in Psychological Science suggests these bad dreams are actually part of the brain’s method of processing emotions. The researchers believe emotional regulation may be the main function of REM sleep, which is the sleep stage where most dreams occur. This stage of sleep may serve to process fear memories so that the system doesn’t become overwhelmed.

Nightmares can actually help distance you from your fears. It serves the purpose to process all the negative emotions in your world. Therefore, if you are struggling with a personal issue in your waking life, it will likely be an issue in your dream life. The nightmare serves as a wake-up call for the conscious to pay attention to the issue you may be ignoring in your waking life.

Sometimes having a bad dream may actually be a good thing for your health.