What to Do When You Can’t Sleep: Techniques to Try

If you’re lying in bed unable to fall asleep, the most effective thing you can do right now is get out of bed. It sounds counterintuitive, but staying in bed while awake trains your brain to associate your bed with wakefulness and frustration. Below are specific techniques you can use tonight, plus longer-term strategies if this keeps happening.

Get Out of Bed After 15 to 20 Minutes

Sleep specialists at Stanford Medicine call this “stimulus control,” and it’s one of the most evidence-backed strategies for insomnia. The rule is simple: if you haven’t fallen asleep within 15 to 20 minutes, get up and move to another room. Do something low-key until you feel genuinely sleepy, then return to bed. If you still can’t sleep, repeat the cycle.

Good activities while you’re up include reading a physical book, doing a crossword puzzle, listening to soft music, writing, drawing, or meditating. Light television is fine as long as the content isn’t stimulating. The goal is to keep your brain occupied without revving it up. Avoid your phone, work emails, or anything that requires problem-solving. The key principle here is that your bed should only be a place where sleep happens, not a place where you lie awake worrying about sleep.

Relax Your Body From Toes to Forehead

Progressive muscle relaxation is a technique recommended by Harvard Health that works by systematically releasing physical tension you may not even realize you’re holding. Start at your feet: curl your toes and arch your feet, hold for a few seconds, then release and let your feet sink into the mattress. Slowly move upward through your calves, thighs, buttocks, lower back, abdomen, upper back, shoulders, arms, hands, neck, jaw, and forehead. Tense each area briefly, then let it go completely.

The military sleep method follows a similar logic. It was reportedly developed to help soldiers fall asleep in two minutes under combat conditions. You relax your face, drop your shoulders, let your arms hang loose, release your chest and legs, then let your feet flop naturally to the sides instead of pointing at the ceiling. Throughout the process, you take long inhales and even longer exhales. The extended exhale is the important part: it activates your body’s “rest and digest” mode, slowing your heart rate and signaling that it’s safe to sleep.

Try a Breathing Pattern

The 4-7-8 technique is one of the most popular breathing methods for sleep. You inhale through your nose for 4 seconds, hold for 7 seconds, then exhale slowly through pursed lips for 8 seconds. The long hold and extended exhale force your breathing to slow dramatically.

That said, research from Brigham Young University found that 4-7-8 breathing had only a small effect on parasympathetic nervous system activation compared to simply breathing at a slow, steady pace of about 6 breaths per minute. So if the 4-7-8 pattern feels awkward or makes you more tense, don’t force it. Just focus on making each breath slow and your exhale longer than your inhale. That alone does most of the work.

Scramble Your Racing Thoughts

If your mind is the problem, not your body, try cognitive shuffling. It works by flooding your brain with random, meaningless images so there’s no room left for anxious thoughts. Your brain interprets this kind of scattered, associative thinking as a signal that sleep is coming, because it mimics the loose, drifting quality of thought that naturally precedes sleep.

Here’s how to do it. Pick an emotionally neutral word with at least five letters. Something boring like “garden.” Take the first letter, G, and think of words that start with G. For each word, briefly picture the object: grape, guitar, goat, glass, gate. When you run out of G words or get bored, move to the next letter, A: apple, anchor, arrow, airplane. Keep going through the word. If you make it to the end without falling asleep, pick a new word and start again. Most people don’t make it past the second or third letter.

Deal With Worries Before Bed

Many people can’t sleep because their brain treats bedtime as the first quiet moment to process everything from the day. You can short-circuit this by scheduling a “worry time” earlier in the evening. Sit down with a piece of paper an hour or two before bed and write out what’s bothering you. For each worry, ask two questions: Is this something I can control? And if so, what’s one concrete step I can take tomorrow?

This works because your brain keeps cycling through unresolved problems. Writing them down and identifying a next step gives your mind permission to let go. It doesn’t solve the problems, but it moves them from an open loop in your head to a closed one on paper. If a worry resurfaces in bed, you can remind yourself it’s already been captured and planned for.

Optimize Your Room for Sleep

Your bedroom temperature matters more than most people realize. Sleep psychologists recommend keeping your room between 60 and 67°F (15 to 19°C). Your body needs to drop its core temperature slightly to initiate sleep, and a cool room makes that process easier.

You can accelerate this temperature drop with a warm bath or shower one to two hours before bed. A meta-analysis of 13 trials found that passive body warming in warm water for as little as ten minutes shortened the time it took to fall asleep by roughly 36%. The warm water dilates blood vessels near your skin’s surface, which causes heat to radiate away from your core once you get out. That cooling effect is what triggers sleepiness.

Beyond temperature, keep your room dark and quiet. If you can’t control noise, a white noise machine or fan helps. Charge your phone in another room, or at minimum place it face-down across the room so the screen isn’t a temptation.

Consider Magnesium

Magnesium is one of the few supplements with reasonable evidence behind it for sleep. A randomized, placebo-controlled pilot trial found that adults with poor sleep quality who took 1 gram of magnesium daily for two weeks reported improvements in both sleep quality and mood compared to placebo. Magnesium glycinate is the form most commonly recommended for sleep because it’s well absorbed and less likely to cause digestive issues than other forms. Taking it about 30 to 60 minutes before bed gives it time to take effect.

When It’s More Than a Bad Night

Everyone has the occasional sleepless night, and the techniques above can help in those moments. But if you’re struggling to fall or stay asleep at least three nights per week, and it’s been going on for three months or longer, that meets the clinical definition of chronic insomnia. At that point, the most effective treatment isn’t a pill or a supplement. It’s a structured program called cognitive behavioral therapy for insomnia, which combines many of the techniques described above (stimulus control, sleep restriction, relaxation training) into a protocol that typically runs four to eight sessions. It has a higher long-term success rate than sleep medication and no side effects.

The single most important thing to remember tonight: if you’ve been lying awake for more than 20 minutes, get up. The worst thing you can do is stay in bed staring at the ceiling, because every minute you spend doing that makes it harder to fall asleep tomorrow night too.