Get some rest. clarissa rossarola / flickr Research shows that being continually sleep-deprived makes you dumb, irritable, distracted, unhappy, and fat — among other terrible things.

But knowing that sleep is necessary, and the science behind why, just makes the feeling of lying awake at 3 a.m. worse.

To help the insomniacs among us get some rest, we gathered the best practices from sleep science.

The experts call it "sleep hygiene." Here's a crash course.

1. Get into a bedroom routine.

Do the same relaxing things before bed every night — the ritual clues your mind and body that it's time to get to bed. Go-to exercises include hot baths and deep reads, which Bill Gates, Arianna Huffington, and other high-achievers swear by.

2. Arrange your bedroom for maximal sleepability.

Sleep to Live Institute director Robert Oexman tells Business Insider that you should keep your room cool (between 65° and 68°F) and dark. Get some blackout curtains if outside lights are an issue.

3. Don't drink alcohol.

Lots of people enjoy a late-night alcoholic beverage before bed, or a nightcap, as the hip kids say.

But while a cognac might make you feel drowsy, it actually screws with your sleep. Research indicates that your body adjusts to the effects of alcohol in the first half of your sleep cycle, but then over-corrects in the second half, giving you lighter sleep — which is part of the reason that a night's rest after drinking is way less refreshing than normal sleep.

4. "Feed" yourself light early in the day.

Our wake-and-rest rhythms are cued by our environments, so like Harvard Medical School recommends, giving yourself a shot of sunlight with a morning run, walk, or simply drinking tea in front a window will tell your body and mind that it's time to be alert, and in doing so set yourself up to rest at night.

It's all about the before-sleep routine. Sebastian.gone.archi / Getty

5. Have a glass of warm milk.

While the research indicates that there's nothing happening at a chemical level that makes you want to sleep, there is a psychological effect — since we associate warm milk with getting rest, it primes us to feel restful.

"Scientists say the routine of drinking a glass of milk before bed can be as soothing as a favorite old blanket," the New York Times reports.

6. Don't use your phone as an alarm clock.

Lots of us rely on our iPhones to wake us up in the morning. The only problem is that if you can't sleep, you'll get the itch to fuss with your phone, which is loaded with app-based stimulants.

Don't let that happen to you.

"Your bedroom should be reserved for sleep, sex, and nothing else," Oxeman says. "There's no excuse — if your cellphone is your alarm clock, then buy a $5 alarm clock and solve the problem."

7. Practice deep breathing.

Putting a little intention into breathing deeply is a way of signaling to your body that it's safe to relax.

Family therapist Vikki Stark walks through the technique on Psychology Today:

"On the inhale, visualize the clean, fresh air coming into your lungs, traveling around your body and cleansing all your cells. On the exhale, imagine all the toxins and negativity being safely expelled into the atmosphere, leaving your body restored. Focus on this steady, calm inhale-exhale, and I guarantee that you will start to feel more peaceful and relaxed. But it's not going to happen the first time you try it. It's an exercise so you need to practice it to get the best effect. Keep going till you feel your body let go."

8. Relax the muscles in your toes.

To release the workday stresses that have made a home in your muscles and tendons, use "progressive muscle relaxation" when you're lying in bed.

It's pretty simple: You tense — then release — a muscle group, and then move on to another one.

Catherine Darley, director of the Institute of Naturopathic Sleep Medicine in Seattle, advises focusing this progressive relaxation technique on your toes.

"Curl your toes tightly for a count of seven, and then relax," she says in Health.com. "Repeat through each muscle group, working up from your toes to your neck."

9. Occupy your mind with a mental exercise.

Counting sheep is so last night. The better option: Sleep expert Dr. Vicky Seelall says to try counting backwards from 100 in multiples of three.

The rhythm of counting can lull you into a sleepy state, and counting in multiples of three has a bit of a challenge to it, so that you'll actually have to pay attention.

10. Get out of bed.

Harneet Walia, a doctor at the Cleveland Clinic's Sleep Disorders Center, says if you can't fall asleep after 30 minutes of lying in bed, you should get up.

"You're basically training your body not to sleep in bed, but to lie there and not sleep," Walia tells US News. "And your mind can get conditioned to that."

So avoid a screen and do something calm, such as reading a book, listening to music, or even doing the dishes.

11. Get your worries out of your head.

If your mind keeps babbling about what might happen tomorrow, next week, or next year, get it out.

Walia suggests "jotting down all your worries on a piece of paper so it's out of your head," which sounds like good advice, given that "expressive writing" has been found to be an awesome approach to soothing anxiety.

12. Get your alarm clock away from you.

One of the worst parts of sleeplessness is the mounting awareness that you're not getting enough sleep.

To avoid that, exile your clock. "No clock watching," Walia says."That's a big no-no. Turn the clock around."

13. Try visualizing a beautiful experience.

If you keep ruminating over something that happened today, occupy your mind elsewhere.

Here's a suggestion, care of Cosmo:

"Picture yourself in a place that's unrelated to whatever's dominating your thoughts, and focus on the specifics of the scenario ... For example, relive a favorite vacation, such as that trip to Mexico, and call to mind sensory details such as the feel of the water on your skin, the colors of the fish you saw while snorkeling, and the taste of the margaritas you sipped at sunset."

The vividness has a helpful side effect: It distracts you from what you'd be thinking of otherwise.

14. Get enough exercise during the day.

Your body isn't going to feel the need to rest if you haven't given it any work during the day.

"If you're sedentary all day, your sleep will suck," Lifehacker reports. "The more active you are, the better your sleep will be."

15. Get a better pillow.

Pillow research (it's a thing) has shown that a medium-firm pillow brings the best improvement to people's sleep. Why? Because a pillow should support your head and neck.

Also, Oprah magazine says to pick up a non-allergenic pillow if you think you might be allergic to down. Then get a dust mite protector to keep those mites from messing with you.

16. Fret less.

Doctors say we're getting too stressed out about sleep — and mentally punishing ourselves for not getting enough rest only complicates things.

"The cultural pressure for us to sleep has never been greater, while in our hurried modern lives the time available in which to sleep has never been so scarce," sleep psychologist Guy Meadows tells the Daily Mail.

The "Sleep Book" author says that the effects cascade from there.

"Your conscious mind starts to worry about sleeping. That keeps you awake at night, and you get into a vicious cycle," he says. "The stress activates ancient, survival-related pathways in your brain that keep you awake in case there is real danger around you at night."

Meadows' advice draws from a theraputic technique called "acceptance and commitment therapy." He teaches his patients to describe and acknowledge their worries instead of trying to fight or block them. With less of an internal battle happening, they can drift off to sleep.

17. See a doctor.

If sleeplessness is a chronic problem, the experts all recommend talking to a professional.

Vivian Giang contributed research to this article.