What to Do When You Can’t Sleep From Stress

When stress keeps you awake, your body is stuck in a state of high alert that directly opposes sleep. Cortisol, the hormone your body releases under stress, activates the same arousal pathways that are supposed to quiet down at night. The good news: you can interrupt this cycle with specific techniques, most of which work within minutes. Here’s what to do tonight and what to change going forward.

Why Stress Physically Blocks Sleep

Sleep requires your nervous system to shift from its “fight or flight” mode into a calmer, restorative state. Stress disrupts this shift. Your brain’s internal clock normally regulates cortisol through a chain reaction: it signals a structure in the brain called the hypothalamus, which triggers the pituitary gland, which tells the adrenal glands to release cortisol. During a normal night, cortisol drops to its lowest levels in the first few hours of sleep and doesn’t rise again until just before waking.

When you’re stressed, this system stays activated. Cortisol remains elevated, your heart rate stays up, your muscles stay tense, and your brain keeps scanning for threats. That’s why lying in bed telling yourself to relax doesn’t work. Your body is running a biochemical program that overrides your intentions. The techniques below work because they target the physiology directly, not just the thoughts.

Get Out of Bed After 20 Minutes

This is counterintuitive but well-supported. Stanford’s Sleep Health and Insomnia Program recommends getting out of bed if you haven’t fallen asleep within 15 to 20 minutes. Go to another room and do something quiet: read, listen to calm music, or watch something low-key. Return to bed only when you feel sleepy again. Repeat this as many times as needed throughout the night.

The key rules: don’t watch the clock obsessively (clock-watching alone can keep you awake), don’t fall asleep on the couch, and don’t do anything stimulating. The point is to break the association between your bed and the frustration of not sleeping. Over time, your brain relearns that bed means sleep, not stress. This technique, called stimulus control, is one of the core components of cognitive behavioral therapy for insomnia.

Use a Breathing Technique to Slow Your Nervous System

Controlled breathing is one of the fastest ways to shift your nervous system out of stress mode. Two techniques are particularly effective before sleep.

4-7-8 breathing: Inhale through your nose for 4 seconds, hold your breath for 7 seconds, then exhale slowly through your mouth for 8 seconds. The extended exhale is what activates your parasympathetic nervous system, the branch responsible for calming you down. Repeat for three to four cycles.

Box breathing: Inhale for 4 seconds, hold for 4 seconds, exhale for 4 seconds, hold for 4 seconds. This technique is widely used in high-pressure environments because it regulates the autonomic nervous system, lowers blood pressure, and creates a sense of calm. It’s a good option if the 7-second hold in the 4-7-8 method feels uncomfortable.

Either technique works. The important thing is the slow, deliberate pattern. It gives your brain something structured to focus on while simultaneously sending a physiological signal that it’s safe to relax.

Try Progressive Muscle Relaxation

Stress creates physical tension you may not even notice until you actively look for it. Progressive muscle relaxation (PMR) works by deliberately tensing and then releasing each muscle group, which helps your body let go of that accumulated tightness.

Lie on your back in a comfortable position. Start with your feet: curl your toes and arch your feet, hold briefly, then release and let them sink into the mattress. Feel the weight of them becoming heavy. Then move slowly upward, tensing and relaxing your calves, thighs, buttocks, lower back, abdomen, upper back, shoulders, arms, hands, neck, jaw, and forehead. Breathe softly throughout. If your mind wanders, gently bring your attention back to whatever muscle group you’re working on.

Most people don’t make it through the full sequence before falling asleep. Even if you do, you’ll feel noticeably more relaxed. Harvard Health Publishing recommends this technique specifically for sleep.

Redirect Racing Thoughts With Cognitive Shuffling

The worst part of stress-related sleeplessness is often the loop of anxious thoughts. Your mind replays problems, rehearses conversations, or spirals into worst-case scenarios. Cognitive shuffling is a technique designed to break that loop by occupying your brain with meaningless, random imagery.

Here’s how it works: pick a simple, neutral word like “table” or “water.” Then, for each letter of that word, think of unrelated words that start with that letter. For “table,” you might picture a tree, a train, a towel for the letter T, then an apple, an arrow, an ant for A, then a book, a bottle, a balloon for B, and so on. Visualize each item as you think of it.

The technique works because it mimics the random, fragmented way your brain processes images as it drifts toward sleep. It’s structured enough to pull your attention away from stressful thoughts but meaningless enough that it doesn’t generate new anxiety. If you lose track of where you are or forget the word, that’s actually a good sign. Just start again with a new word, or let yourself drift off.

Schedule Your Worrying Earlier in the Day

If stress regularly keeps you up, one of the most effective long-term strategies is moving your worrying out of the bedroom entirely. The American College of Lifestyle Medicine recommends setting aside time each evening for “constructive worry,” where you write down your thoughts and concerns well before bed.

Pick a specific 15 to 20 minute window, ideally a few hours before you plan to sleep. Sit down with a notebook and write out everything that’s on your mind: problems, to-do lists, unresolved conflicts, things you’re dreading. For each item, jot down one possible next step, even if it’s small. The act of writing externalizes the worry. Your brain no longer needs to keep cycling through it to make sure you don’t forget.

When those thoughts pop up later in bed, you can remind yourself they’ve already been addressed. You’re not suppressing them. You’re just telling your brain the processing has already happened.

Consider Magnesium for Sleep Support

Magnesium plays a role in regulating stress hormones and supporting the nervous system’s ability to calm down. Many people don’t get enough from diet alone, and supplementing can help with sleep quality. Magnesium glycinate is a well-absorbed form that’s less likely to cause digestive discomfort compared to other types.

The Food and Nutrition Board recommends keeping supplemental magnesium at 350 milligrams per day or less to avoid side effects. This is a reasonable starting point, though the ideal amount varies by age and health status. Magnesium isn’t a sedative. It won’t knock you out the way a sleep aid would. Instead, it supports the underlying conditions your body needs to fall asleep naturally, particularly when stress has depleted your reserves.

Know When Sleeplessness Becomes a Bigger Problem

A few rough nights during a stressful period is normal. But if you’re having trouble falling asleep or staying asleep at least three nights per week for three months or longer, that meets the clinical definition of chronic insomnia. At that point, the problem has typically separated from its original trigger and become self-sustaining. You may be stressed about sleep itself, which creates a new source of arousal that perpetuates the cycle.

Cognitive behavioral therapy for insomnia (CBT-I) is the first-line treatment for chronic insomnia, more effective than sleep medications in the long term. It combines many of the techniques described above, including stimulus control, sleep restriction, and thought restructuring, into a structured program typically lasting six to eight sessions. Many therapists offer it virtually, and several app-based versions are available if in-person therapy isn’t accessible.