When anxiety keeps you awake, your body is stuck in a state of high alert that actively blocks sleep. This isn’t a willpower problem. Your stress system is flooding your body with hormones that promote wakefulness, and the harder you try to force sleep, the worse it gets. The good news: specific techniques can break this cycle, both tonight and over time.
Why Anxiety Makes Sleep Feel Impossible
Your body’s stress response and your sleep system are locked in a tug-of-war. Deep sleep normally suppresses the production of stress hormones like cortisol, but when your stress system is activated, it does the opposite: it promotes arousal and blocks sleep. People with insomnia have measurably higher cortisol levels across a full 24-hour period than normal sleepers, with the biggest spikes happening in the evening and first half of the night, exactly when you need those levels to drop.
At the same time, a brain region called the locus caeruleus, which controls alertness, fires at its highest rate during wakefulness and its lowest during sleep. When you’re anxious, this region stays active. Your brain is essentially telling your body it’s not safe to sleep. Add in the racing thoughts and physical tension that come with anxiety, and you get a feedback loop: anxiety prevents sleep, poor sleep increases anxiety, and the cycle deepens.
What to Do Right Now in Bed
Stop Trying to Fall Asleep
This sounds counterintuitive, but the pressure you put on yourself to sleep is part of what keeps you awake. A technique called paradoxical intention flips the script: instead of trying to fall asleep, you gently try to stay awake with your eyes closed and the lights off. You’re not doing anything stimulating. You’re just giving up the effort to sleep. This works because it removes the performance anxiety that builds when you’re watching the clock and calculating how few hours you have left. When you stop trying so hard, your body’s natural sleep drive can take over.
Use a Breathing Technique
Slow, controlled breathing is one of the fastest ways to shift your nervous system out of fight-or-flight mode. Two options work well:
- 4-7-8 breathing: Inhale through your nose for 4 seconds, hold for 7 seconds, exhale slowly through your mouth for 8 seconds. The long exhale is the key part, as it activates the calming branch of your nervous system.
- Box breathing: Inhale for 4 seconds, hold for 4 seconds, exhale for 4 seconds, hold for 4 seconds. This is simpler to remember and equally effective at lowering your heart rate and blood pressure.
Do either pattern for several minutes. You may not feel dramatically different after two or three cycles, but by the fifth or sixth, most people notice their heart rate slowing and their muscles loosening.
Ground Yourself With Your Senses
If your thoughts are spiraling, the 5-4-3-2-1 technique forces your brain to focus on the present moment instead of whatever you’re worried about. Start with a few slow breaths, then work through your senses:
- Notice 5 things you can see (even in a dark room, you can pick out shapes and shadows)
- Notice 4 things you can touch (the texture of your pillow, the weight of your blanket, the temperature of the air on your skin)
- Notice 3 things you can hear
- Notice 2 things you can smell
- Notice 1 thing you can taste
This isn’t about relaxation in the traditional sense. It’s about pulling your attention out of your head and anchoring it to something concrete. Many people find they feel noticeably calmer by the time they reach the last step.
Get Out of Bed if You’re Still Awake
If you’ve been lying awake for roughly 15 to 20 minutes and you’re not getting drowsy, get up. Go to another room, keep the lights dim, and do something quiet and low-stimulation: read a physical book, listen to calm music, or fold laundry. Return to bed only when you feel genuinely sleepy. This comes from a well-established approach called stimulus control, and the goal is to train your brain to associate your bed with sleep rather than with lying awake and worrying. The more hours you spend tossing and turning in bed, the stronger the association between your bed and wakefulness becomes.
Daytime Habits That Reduce Nighttime Anxiety
Schedule a Worry Period
One of the most effective techniques for nighttime rumination happens hours before bed. Choose a specific time, place, and duration for worrying, something like 6 p.m. at your kitchen table for 20 minutes. The location should be somewhere you don’t normally relax, not your couch or your bed. During this period, write down everything that’s on your mind. If worries pop up at other times during the day, acknowledge them briefly and postpone them to your worry period.
This works because it gives your brain a designated container for anxious thoughts. When worries surface at 11 p.m., you can remind yourself they’ve already been addressed, or that they’ll get addressed tomorrow at 6. Over time, this reduces the sense that bedtime is your only opportunity to process problems.
Set a Consistent Wake Time
This matters more than your bedtime. Waking up at the same time every morning, including weekends, strengthens your body’s internal clock and makes it easier to fall asleep at a predictable time each night. It’s tempting to sleep in after a rough night, but irregular wake times make the next night worse.
Limit Napping
After a night of anxiety-driven insomnia, a nap feels essential. But long or late-afternoon naps reduce the sleep pressure that helps you fall asleep at night, restarting the cycle. If you must nap, keep it under 20 minutes and before 2 p.m.
When the Problem Persists
If anxiety-related sleep problems last more than a few weeks, the most effective treatment is cognitive behavioral therapy for insomnia, commonly called CBT-I. The American Academy of Sleep Medicine gives it the strongest possible recommendation as a first-line treatment, preferred over medication because the benefits last after treatment ends. A typical course takes six to eight weeks. In clinical trials, CBT-I reduced the time it takes to fall asleep by an average of 19 minutes and cut nighttime wakefulness by 26 minutes, with sleep efficiency improving by about 10%. These numbers hold for people with psychiatric conditions like anxiety, not just those with standalone insomnia.
CBT-I combines several of the techniques described above (stimulus control, sleep scheduling, cognitive restructuring) into a structured program. It’s available through therapists, sleep clinics, and several app-based programs for people who can’t easily access in-person care. The improvements tend to be gradual rather than immediate, but they’re durable in a way that sleep medications typically aren’t.
What About Magnesium and Supplements
Magnesium is one of the more popular over-the-counter options for sleep and anxiety, and there is some preliminary evidence behind it. In one study of adults with anxiety, about 42% of participants taking a magnesium supplement experienced at least a 50% reduction in anxiety scores over four weeks. However, most research has used magnesium oxide rather than the glycinate form that’s commonly marketed for sleep, and researchers haven’t been able to determine which form works best or at what dose.
Magnesium is generally safe for most people at standard supplemental doses, but the evidence isn’t strong enough to call it a reliable treatment. If you’re looking for something to try alongside behavioral strategies, it’s a reasonable low-risk option, but it’s not a substitute for addressing the underlying patterns that keep anxiety and sleeplessness feeding each other.

