Numerous studies have shown the importance of getting a good night’s rest, but we don’t always have the best habits at bedtime.

Watching TV before dozing off or sleeping without brushing your teeth or flossing are a few less-than-ideal practices. While no one is perfect, sleep doctors have steps they take to try to doze off without any distractions to keep them up at night. Several of them have shared the things they avoid with HuffPost and a few of them are below.

Getting a workout

While experts say physical activity creates more adenosine in the brain and makes us feel sleepy, exercising late in the day can have the opposite effect.

Sleep medicine expert Dr. Steven Holfinger of the Ohio State University Wexner Medical Center in Columbus told U.S. News that “exercise enters you into an activating state that makes it harder to fall asleep temporarily."

Studies have advised avoiding strenuous exercise at least one hour before bedtime.

Staying awake in bed

We’ve all experienced it at one point or another: lying awake in bed at night staring at the wall. Experts say doing that can be harmful down the road.

“If you don’t fall asleep within 20 minutes of going to bed, get up, go to another room and do a calming activity, then go back to bed," Dr. Guy Leschziner, a consultant neurologist at the sleep disorder center, Guy’s and St. Thomas' hospitals in London told The Guardian. "If you are lying in bed unable to sleep, your brain will soon start associating lying in bed with being awake.”

Drinking alcohol

You may have heard of sipping a nightcap before bed, but experts warn against having one containing alcohol.

“Some people end up self-medicating with a nightcap, because it does help them to fall asleep more easily at the beginning of the night," Stacey Gunn, sleep medicine physician at the Insomnia and Sleep Institute of Arizona, told HuffPost. "But I recommend against it because it causes the sleep architecture to be disrupted later on, resulting in poor quality sleep.”

Consuming caffine

Much like drinking alcohol before bed, experts don’t consume the stimulating drug before getting some shut-eye.

“If you have caffeine later in the day, it can actually predispose you to develop insomnia or make it worse if you already have it,” Dr. Rachel Salas, an associate professor of neurology at Johns Hopkins Medicine who specializes in sleep medicine, told Self magazine.

Still, it’s important to note that recent studies have indicated that drinking coffee before bed may not be as bad as other pre-sleep habits, such as using nicotine or drinking alcholic beverges.

Using their phones or laptops sans blue light filter

Researchers have noted that blue light from cellphones and TV screens can delay the production of melatonin — the hormone that regulates the sleep-wake cycle — in the body.

“Checking your phone stimulates the brain so we are more active and awake,” Cleveland Clinic sleep disorder specialist Dr. Harneet Walia told Health Essnetials. “Even just a quick check can engage your brain and prolong sleep.”