Did you sleep well last night? If not, you’re not alone.

According to the World Association of Sleep Medicine, two billion people worldwide report that they are suffering from insomnia, and 46 per cent report missing work or making mistakes at work due to sleep disturbances.

While we already know that being sleep deprived can lead to a host of health issues, including increased risk of obesity, diabetes and cardiovascular disease, other research suggests it can be toxic for your brain as well.

The results of a 2015 Canadian study suggest that poor sleep quality can prevent the brain from ridding itself of toxins built up during normal daily activities, which has implications for such brain diseases as Alzheimer’s, as well as for stroke recovery.

“It’s not only about the hours of sleep you get, it’s having fairly continuous sleep that is also important,” says Dr. Mark Boulos, a neurologist and sleep specialist working with The Sunnybrook Research Institute in Toronto and one of the authors of the study.

Scientists don’t fully understand how the brain flushes toxins, but MRIs from the study show that people who only had three hours of sleep had a build-up of toxins in the brain, whereas those who had a good night’s sleep did not.

Courtney Berezuk, a clinical researcher with the L.C. Campbell Cognitive Neurology Research Unit at Sunnybrook, likened the brain’s ability to cleanse itself to the way a toilet functions.

“We go to sleep at night, the brain opens up, and the fluid is able to rush through, cleaning it out, similar to how a toilet would flush out waste … that’s a simple view of what’s going on,” she said in a recent interview. So with a poor sleep, the brain doesn’t have the power to fully flush these toxins.

Boulos says the study is important since up to now a lot of the research into stroke and dementia has focused on diet and exercise for improving the health of blood vessels, while the impact of sleep has been largely overlooked.

There are different types of sleep deprivation, explains Boulos. If you have trouble getting to sleep, that’s known as initial insomnia. If you wake up and then have a hard time getting back to sleep, that’s known as middle insomnia. If you wake up frequently all through the night (people with prostate issues or untreated sleep apnea often fall into this category) you have what’s called fragmented sleep. A normal sleep for most adults is eight hours with one pee break during the night, he says.

5 Tips for Better Sleep

1) Don’t nap: “Save all that fatigue for night time,” he suggests, since if you snooze during the day you’re simply not going to feel as tired at night. (People who are ill or in recovery may need to nap, he adds.)

2) Avoid excessive alcohol consumption: While alcohol may actually help you fall asleep faster, it’s known to disrupt your overall sleep pattern – and the more you drink the worse the effect. It reduces rapid eye movement (REM), which begins about 90 minutes after we fall asleep and is believed to be an important part of a good night’s sleep.

3) Don’t take sleeping pills: You may think you’re sleeping well because you don’t wake up, but sleeping pills also disrupt the normal “sleep architecture”, says Boulos. They can also have side effects, especially in older people, who may experience such things as sluggishness, and unsteadiness on their feet.

4) Stay away from caffeine: “It’s particularly important not to have any caffeine within six hours of bedtime,” says Boulos. That means no coffee or certain soft drinks, like colas.

5) Limit TV and computer use at night: The light from your TV or computer screen tricks your brain into thinking it’s daytime and can throw off your body’s natural rhythms, says Boulos, making it hard to get to sleep.

Since sleep is so essential for good health, Boulos says anyone who has trouble sleeping should definitely talk to their doctor and get a referral to a sleep specialist if necessary. Many of the disorders that cause poor quality sleep can be treated, he says.