Sleep allows your brain to recharge and improves how it functions. However, some of your daily habits might be getting in the way of you achieving healthy sleep.

A recent study published in the journal the Nurse Practitioner looked at how caffeine, napping and using sleep medications prolong your inability to reach the REM — rapid eye movement — phase of sleep. The researchers monitored 137 participants who had sleep apnea, insomnia or another sleep issue.

“Patients will use caffeine and nicotine and nap to combat daytime somnolence and not even realize that these precipitate and perpetuate the insomnia even more,” Rhonda Winegar, PhD, DNP and author of the study, said in a press release. “Making small modifications to daily routines can help much more than prescribing hypnotics that have side effects and run the risk of dependency.”

About 80% of Americans consume caffeine daily, making it the country’s most popular drug. That caffeine habit can affect a person’s quality of sleep, research has found. During the recent study, Winegar found that participants who consumed caffeine reached REM sleep later than people who avoided the stimulant.

According to the Sleep Foundation, caffeine overuse can cause symptoms of or worsen insomnia, which can then lead to sleepiness during the day. To avoid this, the Sleep Foundation recommends stopping your consumption of caffeine six hours before bedtime in order to not disrupt sleep.

Winegar also found one-fourth of the participants took daily naps, which helped during the day but caused problems falling asleep at night. According to the Cleveland Clinic, napping fewer than 20 minutes does not affect your nighttime sleep, but any longer can carry risks.

For example, the clinic found, longer naps disrupt your ability to reach deep sleep at night, which then increases grogginess and tiredness during the next day. In addition, naps longer than 60 minutes can increase your risk of heart disease and death, according to a 2020 study.

It wasn’t just caffeine causing problems, Winegar found. Prescribed medicines, over the counter treatments and herbal alternatives caused participants to reach REM sleep 30 minutes slower than those who avoided sleep aids. In fact, the study found that those who used sleep aids actually had fragmented and disrupted sleep.

To get a better night’s sleep, Johns Hopkins recommends making sure your room is dark and at an ideal temperature, exercising daily, and even drinking warm milk before bed instead using medication.

For more content like this, sign up for the Pulse newsletter here.