Anxiety keeps you awake by doing the exact opposite of what your body needs at bedtime: it raises your heart rate, floods your system with stress hormones, and locks your brain into a loop of threat-scanning that makes drifting off feel impossible. The good news is that specific techniques can interrupt this cycle, and most of them work within minutes once you learn them. Here’s what actually helps.
Why Anxiety Makes Sleep So Difficult
Sleep requires your nervous system to shift into a calm, low-alert state. Anxiety does the opposite. When you’re anxious, your brain ramps up production of cortisol and norepinephrine, the same chemicals that would help you run from danger. Cortisol levels in people with insomnia are measurably elevated in the evening and at sleep onset, precisely when they should be dropping. Those elevated evening cortisol levels directly correlate with more nighttime awakenings, even in people who don’t have a diagnosed sleep disorder.
This creates a frustrating feedback loop. Stress hormones fragment your sleep, and fragmented sleep raises cortisol levels further the next day. Over time, excess cortisol reduces the amount of deep sleep you get and increases the time it takes to fall asleep in the first place. Your brain essentially starts treating the bed as a place where you worry rather than a place where you rest, which makes the problem self-reinforcing.
Slow Your Heart Rate With Controlled Breathing
The fastest way to counteract your body’s stress response is controlled breathing, specifically patterns where your exhale is longer than your inhale. The 4-7-8 technique is one of the most studied: breathe in through your nose for 4 seconds, hold for 7 seconds, then exhale slowly through your mouth for 8 seconds. In a controlled trial of healthy adults, this pattern reduced resting heart rate by about 5 beats per minute on average and significantly lowered blood pressure, both after just a few minutes of practice.
That drop matters because your heart rate is one of the signals your brain uses to decide whether it’s safe to sleep. You don’t need to do this perfectly. If holding for 7 seconds feels uncomfortable, shorten it. The key principle is making the exhale longer than the inhale, which activates the branch of your nervous system responsible for rest and recovery. Three to five cycles is usually enough to notice a shift.
Break the Thought Loop With Cognitive Shuffling
Anxious thoughts before bed tend to be sticky. You replay a conversation, worry about tomorrow, or spiral into what-ifs. Telling yourself to “stop thinking” rarely works because your brain needs something else to do. Cognitive shuffling, developed by a cognitive scientist at Simon Fraser University, gives it exactly that: a task engaging enough to displace worry but boring enough to let you drift off.
Here’s how it works. Pick a neutral word with at least five letters, like “GARDEN.” Take the first letter, G, and slowly visualize random things that start with G: a grape, a goat, a guitar, a globe. Spend a few seconds imagining each one before moving to the next. When you run out of G words or get bored, move to A, then R, and so on. If a word triggers any emotion or stress, skip it and pick another. Most people don’t make it past the second or third letter before falling asleep.
This works because your brain can’t simultaneously generate random, unconnected images and sustain a coherent worry narrative. The task is just structured enough to keep your attention but too pointless for your brain to stay alert for.
Ground Yourself With Your Senses
If your anxiety is more physical than mental (racing heart, tight chest, restless legs), a grounding exercise can pull your attention out of your head and into your body. The 5-4-3-2-1 technique uses each of your senses as an anchor.
- 5 things you see: Even in a dark room, you can notice the outline of a window, the glow of a clock, shadows on the ceiling.
- 4 things you can touch: The weight of your blanket, the texture of your pillowcase, the temperature of the air on your skin.
- 3 things you hear: Focus on sounds outside your body. A fan, distant traffic, the hum of a refrigerator.
- 2 things you smell: Your pillow, laundry detergent on your sheets, the air from an open window.
- 1 thing you taste: Toothpaste, the inside of your mouth, a sip of water you keep on the nightstand.
Start with a few slow breaths before going through the steps. The exercise works by redirecting your nervous system toward present-moment sensory input, which competes with the abstract future-oriented thinking that fuels anxiety.
Retrain Your Brain to Associate Bed With Sleep
One of the most effective long-term strategies comes from cognitive behavioral therapy for insomnia, specifically a component called stimulus control. The idea is simple: if you’ve spent weeks or months lying in bed anxious and awake, your brain has learned that bed equals wakefulness. You need to reverse that association.
The core rules, developed by sleep researcher Richard Bootzin and now standard in clinical practice:
- Only go to bed when you’re genuinely sleepy, not just tired. Sleepy means your eyelids are heavy and you’re struggling to stay awake. Tired means you’re fatigued but your mind is still active.
- If you can’t fall asleep within roughly 15 to 20 minutes, get up. Go to another room and do something quiet and low-stimulation (reading a physical book, gentle stretching) until you feel sleepy again, then return to bed.
- Set a consistent wake time every morning, including weekends. This anchors your circadian rhythm more powerfully than any other single habit.
- Limit naps to 15 to 30 minutes, taken 7 to 9 hours after your wake time if you need one. Longer or later naps steal sleep pressure from the evening.
The first few nights of this approach can feel counterintuitive, even uncomfortable. You might spend less total time in bed. But within one to three weeks, most people find they fall asleep faster and wake up less often because their brain has relearned that bed is for sleeping.
What to Do Earlier in the Evening
What happens in the two hours before bed shapes how easily you fall asleep. A few adjustments during this window can lower your baseline anxiety level before you ever get under the covers.
Write down tomorrow’s tasks and worries on paper before you start winding down. This isn’t journaling for self-reflection. It’s a brain dump: get the to-do list, the unresolved argument, and the financial worry out of your head and onto a page. Research on “constructive worry” shows that externalizing concerns reduces the mental load your brain carries into bed.
Dim the lights in your home at least an hour before bed. Bright overhead lighting suppresses melatonin production and signals daytime alertness to your brain. If you’re scrolling your phone, switch to night mode, but ideally put the phone in another room entirely. Social media and news are specifically designed to provoke emotional reactions, which is the last thing an anxious brain needs before sleep.
Keep your bedroom cool. Your core body temperature needs to drop slightly to initiate sleep, and a room between 65 and 68°F (18 to 20°C) supports that process. A warm shower 60 to 90 minutes before bed can help too, not because of the warmth itself, but because of the rapid cooling that happens when you step out.
Whether Magnesium Supplements Help
Magnesium is one of the most commonly recommended supplements for sleep anxiety, and there is some evidence behind it, though it’s less definitive than the marketing suggests. In one systematic review, about 42% of participants taking magnesium supplements experienced a 50% or greater reduction in anxiety scores. Self-reported anxiety also decreased significantly in a study using magnesium glycinate over six months, though three months wasn’t long enough to see a clear benefit.
The challenge is that most clinical studies used magnesium oxide, which is the cheapest and most common form but also the worst absorbed. Magnesium glycinate and magnesium bisglycinate are generally better tolerated and absorbed, but fewer rigorous studies have tested them specifically. If you want to try supplementation, glycinate is a reasonable choice, but give it at least a few months before judging whether it helps. It’s a slow-building effect, not a sleeping pill.
When Anxiety-Related Insomnia Needs More Support
If you’re struggling to sleep at least three nights per week and this has been going on for three months or longer, that meets the clinical threshold for chronic insomnia. At that point, self-help strategies alone may not be enough. A structured course of cognitive behavioral therapy for insomnia, delivered by a therapist or through validated digital programs, is the first-line treatment recommended over medication by every major sleep medicine organization. It works for roughly 70 to 80% of people who complete it, and unlike sleep medications, the benefits persist after treatment ends.
Anxiety disorders and insomnia frequently co-occur, and treating one often improves the other. If your daytime anxiety is severe enough that it’s affecting your work, relationships, or ability to function, addressing the anxiety directly through therapy or medication will likely improve your sleep more than any bedtime technique on its own.

