Checking your phone right before bed is not doing your sleep any favors.

If You Can’t Fall Asleep When Your Head Hits the Pillow, Here’s What to Do

1. Ditch the Devices

Sleep doctors have been telling you for years to stop using smartphones, laptops, and tablets right before bed — and for good reason. Not only does the light from electronic screens mess up your melatonin production — which makes sleep physiologically harder to achieve — it also can also heighten anxiety and stress, especially if you’ve just received stressful news via email or social media. It makes the cycle of ruminating about bothersome or unpleasant news worse, Dr. Chan says.

Plus, the apps, websites, and news you’re consuming on such devices are meant (in large part) to keep you (and your brain) engaged, he adds. “The internet is designed to capture attention so that you spend more eye time on screens, which can be a detriment to sleep.”

To protect your shut-eye, switch off devices one to two hours, or 30 minutes at a minimum, before bed.

2. Schedule Worry Time

Just as you schedule time to see friends or get a massage, do the same with your worries. Schedule a consistent time every day (about 15 to 30 minutes), at least one to two hours before bed, to write down those worries on paper. In addition to writing down what’s worry you, create at least one action item you can do to help deal with the issue. Thinking through those potential stressors earlier in the day should help ease how much you worry about those things when you head hits the pillow, Chan says. “Ideal sleep depends on creating routines and schedules, and this is no different.”

3. Create a Routine to Power Down Your Brain

Most people assume that sleep is like breathing — your body will just do it. Not true. Modern-day living has created so much stimulation in the day that brains now operate at warp speed, and if you don’t give them time to rest, they’ll continue going at that speed at bedtime, says David Brodner, MD, founder and principle physician at the Center for Sinus, Allergy, and Sleep Wellness in Boynton Beach, Florida.

At least 30 minutes before you go to bed, start your pre-bed preparations and then do something relaxing, like listening to music or reading. Keep it consistent, and you’ll train your body to expect sleep after that relaxation period.

4. Keep a Gratitude List

Now that you’ve dumped your worries, replace the void where those negative thoughts once lived with positive ones by starting a gratitude journal, Breus suggests. The impact of those positive thoughts is greater when you write them down. So try spending a few minutes each night listing three to five things you’re grateful for.

5. Practice 4-7-8 Breathing

You’ve heard about deep breathing for stress, but there’s a good reason it’s so effective for sleep. In order to get to sleep, your heart rate needs to slow down, Breus says. And breathing techniques are one of the most effective ways to achieve this goal.

One of Breus’s favorites is 4-7-8 breathing: Inhale for a count of four, hold for seven counts, and then blow out for eight counts. Do this at least five to seven times, and your heart rate will slow way down.

6. Do Progressive Muscle Relaxation

As you lie in bed, tense and relax all of your muscles one by one, starting at your toes and ending at your head. Not only is this incredibly relaxing, as the name implies, it also forces you to think about the physical parts of your body, directing your attention away from whatever thoughts or stressors you’re ruminating about, Breus says.

7. Maintain a Consistent Sleep Schedule

This is one of the pillars of sleep hygiene, those guidelines sleep docs recommend for ensuring a good night’s sleep. It helps the mind, too. “If you try to go to bed early when your brain’s not ready to sleep, it will focus on other things, making you aroused,” Breus says.