What to Do If You Can’t Sleep at Night

If you’re lying in bed unable to fall asleep, the single most effective thing you can do is get up. It sounds counterintuitive, but staying in bed while awake trains your brain to associate your bed with frustration rather than sleep. Beyond that first step, there are several techniques you can use tonight and habits you can adjust starting tomorrow to make falling asleep easier.

Get Out of Bed After 15 to 20 Minutes

When you can’t fall asleep, or you wake up in the middle of the night and can’t drift back off, give yourself roughly 15 to 20 minutes before getting up and moving to another room. You don’t need to watch the clock precisely. Checking the time repeatedly will only make things worse. Just estimate.

Once you’re up, do something quiet and low-stimulation: read a book, do a crossword puzzle, listen to soft music, sketch, or meditate. The goal is to occupy your mind gently without waking yourself up further. Avoid housework, exercise, video games, or working on a computer. These activities are too stimulating and signal to your brain that it’s time to be productive, not sleep. When you start to feel genuinely drowsy, go back to bed. If sleep doesn’t come again within 15 to 20 minutes, repeat the process. Don’t sleep on the couch. You want your brain to learn that your bed is the only place for sleep.

Stop Trying So Hard to Fall Asleep

One of the biggest obstacles to falling asleep is the pressure you put on yourself to do it. The more you try to force sleep, the more alert you become. This creates a frustrating loop: you worry about not sleeping, which keeps you awake, which gives you more to worry about.

A technique called paradoxical intention flips this on its head. Lie comfortably in bed with the lights off, but keep your eyes open. Give up any effort to fall asleep and any concern about still being awake. When your eyelids start to feel heavy, gently tell yourself, “Just stay awake for another couple of minutes. I’ll fall asleep when I’m ready.” You’re not actively trying to stay awake. You’re simply removing the pressure to sleep. By shifting your focus away from the attempt to fall asleep, sleep tends to arrive on its own.

Another version of this approach is even simpler: treat wakefulness as an opportunity instead of a catastrophe. Think of all the terrible things that will supposedly happen because you’re awake, then recognize how exaggerated and absurd they are. Most people overestimate how badly a rough night will affect the next day. Letting go of that fear often loosens the grip insomnia has on you.

Use Your Breathing to Trigger Relaxation

Your body has a built-in calming system, and you can activate it with slow, structured breathing. The 4-7-8 technique is one of the simplest versions: inhale through your nose for four counts, hold your breath for seven counts, then exhale slowly through your mouth for eight counts. Repeat this cycle three or four times.

This pattern works because the extended exhale activates your parasympathetic nervous system, the part of your nervous system responsible for shifting your body from a state of alertness into calm. The more consistently you practice this, even during the day, the faster your body learns to respond to it at night.

Try Cognitive Shuffling for Racing Thoughts

If your mind won’t stop spinning through worries, to-do lists, or replays of the day, cognitive shuffling can break the cycle. Cognitive scientist Luc Beaudoin developed this technique based on research showing that as people fall asleep, their thoughts naturally become random and fragmented. By mimicking that randomness on purpose, you can nudge your brain toward sleep.

Pick a simple word, like “lamp.” Focus on the first letter, L, and think of as many words starting with L as you can: lemon, ladder, lake, llama. Visualize each one briefly. When you run out, move to the next letter, A: apple, airplane, acorn. Continue through the word. If you lose track of where you are or forget the original word entirely, that’s a good sign. The goal isn’t concentration. It’s the opposite. You’re giving your brain something boring and meaningless to chew on so it stops latching onto stressful thoughts. If you finish one word and you’re still awake, start with a new one.

Manage Light Exposure Before Bed

Light is the most powerful signal your brain uses to decide whether it’s time to be awake or asleep. Exposure to light, especially the blue wavelengths emitted by phone screens, tablets, and laptops, suppresses your body’s production of melatonin, the hormone that tells your brain it’s nighttime. Even dim light can interfere. A standard table lamp produces enough brightness to affect melatonin secretion.

Put your screens away at least an hour before bed. If that feels impossible, at minimum enable a night mode that filters blue light and dim the screen as much as possible. Keep your bedroom dark. If light comes in from outside, blackout curtains or a sleep mask can make a noticeable difference. In the morning, do the opposite: get bright light exposure as early as you can. This strengthens your circadian rhythm and makes it easier to feel sleepy at a consistent time each night.

Watch Your Caffeine Timing

Throughout the day, a chemical called adenosine builds up in your brain. The longer you’re awake, the more adenosine accumulates, and the sleepier you feel. Caffeine works by blocking adenosine’s effects, which is why coffee makes you feel alert. The problem is that caffeine sticks around for a long time. Its half-life is four to six hours for most people, meaning that if you drink a cup of coffee at 3 p.m., half of that caffeine is still active in your brain at 9 p.m. For some people, the half-life can stretch to 12 hours.

If you’re having trouble sleeping at night, try cutting off caffeine by noon or early afternoon and see if it makes a difference over a week or two. Remember that caffeine isn’t just in coffee. Tea, chocolate, energy drinks, and some sodas all contain enough to matter.

Consider Magnesium Supplements

Magnesium plays a role in the nervous system pathways involved in sleep, and many people don’t get enough of it from food alone. A dose of 250 to 500 milligrams taken at bedtime may help with relaxation and sleep quality. If you have healthy kidney function, magnesium supplements are generally safe. The citrate form has the most research behind it for sleep, but it also acts as a laxative, so glycinate or other forms may be more practical for nightly use.

When Sleeplessness Becomes a Pattern

Everyone has the occasional rough night. But if you’re struggling to fall asleep 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 insomnia disorder. At that point, the most effective treatment isn’t a sleeping pill. It’s a structured program called cognitive behavioral therapy for insomnia (CBT-I), which teaches the same principles described above, like stimulus control, sleep restriction, and thought management, in a systematic way tailored to your specific patterns. Many people see significant improvement within four to eight weeks. Your doctor can refer you, or several validated online programs offer guided CBT-I.