Once you’ve established that you were not, in fact, chased by a grizzly bear at the office holiday party while wearing only a baseball cap, you may next wonder why your nightmare happened in the first place—so you can avoid another one in the future. Luckily, there’s something you can do at night if you’re aiming to have sweeter dreams. Read on to find out what it is. READ THIS NEXT: If You Take This Common Medication to Sleep, Stop Now, New Study Says “There is still much to know about our sleep process and how dreaming works,” says Ryan C. Warner, PhD, Clinical Psychologist and Team Wellness Expert at 1AND1 Life, a Black-owned mental health and wellness performance company. “However, we know that when we sleep, our brain goes through multiple sleep cycles. These cycles are composed of four stages,” he explains. “The first three fall into the non-REM (NREM) sleep category. During the first and second stages, you start to doze off and your body relaxes. Your body temperature, brain activity, heart rate, and respiration slow down.“ae0fcc31ae342fd3a1346ebb1f342fcb As you enter deep sleep in stage three, your muscles continue to relax and your brain activity slows even more. Next up is stage four, when rapid eye movement (REM) occurs, along with dreaming as brain activity increases again. So far, it’s a normal night’s sleep—unless you haven’t been sleeping enough. If you’re sleep-deprived, this could be throwing off your nighttime cycle and potentially causing nightmares. Dreaming is part of a normal sleep cycle, but this pattern can be disrupted if you’re not getting enough sleep. Once you’ve progressed to REM sleep—which consists of about 20-25 percent of total sleep in adults—your body becomes immobilized. “Your eyes are moving, but they don’t send any information to your brain,” says Warner. “Here is where dreams and nightmares tend to happen, caused by rapid brain activity.” Warner explains why this stage is important: “It is associated with stimulating the areas of the brain that help with learning and long-term memory.” If you haven’t been sleeping enough, you can experience a REM rebound, and “spend more time in REM sleeping than [you] normally would,” says Warner. “A REM rebound usually results in vivid dreams and nightmares that make it harder to rest.” The more sleep-deprived you are, the more of an effect it has on your sleep. According to the Sleep Foundation, “sleepers who were deprived of three to six hours of sleep only experienced NREM rebound. Experiencing 12 to 24 hours of sleep deprivation increased both REM and NREM sleep, while more than 96 hours of sleep deprivation resulted in significant REM rebound sleep.” For more health news sent directly to your inbox, sign up for our daily newsletter. The Sleep Foundation says that adults between 18 and 64 should aim to sleep for seven to nine hours per night, while seven to eight hours is suggested for people over 65. And yet ​​35.2 percent of American adults say they regularly sleep for less than seven hours a night, and almost half report feeling sleepy during the day between three and seven days per week. An increased feeling of fatigue isn’t the only effect. “Sleep deprivation can have long-term effects on your health,” warns Warner. “Memory issues, a weak immune system, heart disease, depression, anxiety, and being more prone to accidents are just some of the side effects of not sleeping enough.” In fact, just one night of sleep deprivation can have a negative effect on these aspects of your health, in addition to your mood, sex drive, and pain threshold—as well as nightmares triggered by REM rebound. To avoid nightmares and adverse effects on your physical and emotional health, there are many lifestyle adjustments you can make if you’re not getting enough sleep. Creating–and adhering to—a sleep routine is essential; this includes setting regular sleep and wake times, relaxing before bed with a book or a bath, staying away from screens at night, and abstaining from certain foods. If you experience trouble falling asleep or insomnia due to factors such as stress, eating habits, or even as a long-term COVID effect, there are ways to alleviate it. Your healthcare provider may want to give you a physical exam, possibly including a blood test, to rule out potential illness, as well as ask you about your sleep habits. They may even have you undergo a sleep study. If you’re prescribed an over-the-counter sleep aid or supplement, be forewarned that if you’re dealing with nightmares, melatonin supplements could make them worse. Ask your doctor whether therapy may be helpful: According to the Mayo Clinic, “Cognitive behavioral therapy for insomnia (CBT-I) is generally recommended as the first line of treatment,” and “is equally or more effective than sleep medications.” READ THIS NEXT: If You Do This When You Sleep, Talk to Your Doctor, Study Says.