If you’ve ever crawled under the covers worrying about a problem or a long to-do list, you know those racing thoughts may rob you of a good night’s sleep. Sleep disturbances, like having a hard time falling asleep or staying asleep, affect millions of Americans.

The daytime sleepiness that follows can leave you feeling lousy and sap your productivity, and it may even harm your health. Now, a small study suggests that mindfulness meditation — a mind-calming practice that focuses on breathing and awareness of the present moment — can help.

A study published a few years ago in JAMA Internal Medicine included 49 middle-aged and older adults who had trouble sleeping. Half completed a mindfulness awareness program that taught them meditation and other exercises designed to help them focus on “moment-by-moment experiences, thoughts, and emotions.” The other half completed a sleep education class that taught them ways to improve their sleep habits.

Both groups met six times, once a week for two hours. Compared with the people in the sleep education group, those in the mindfulness group had less insomnia, fatigue, and depression at the end of the six sessions.

The findings come as no surprise to Dr. Herbert Benson, director emeritus of the Harvard-affiliated Benson-Henry Institute for Mind Body Medicine. “Mindfulness meditation is just one of a smorgasbord of techniques that evoke the relaxation response,” says Dr. Benson.

The relaxation response, a term he coined in the 1970s, is a deep physiological shift in the body that’s the opposite of the stress response. The relaxation response can help ease many stress-related ailments, including depression, pain, and high blood pressure. For many people, sleep disorders are closely tied to stress, says Dr. Benson.

Mindfulness meditation involves focusing on your breathing and then bringing your mind’s attention to the present without drifting into concerns about the past or future. It helps you break the train of your everyday thoughts to evoke the relaxation response, using whatever technique feels right to you.

Dr. Benson recommends practicing mindfulness during the day, ideally for 20 minutes, the same amount suggested in the new study. “The idea is to create a reflex to more easily bring forth a sense of relaxation,” he says. That way, it’s easier to evoke the relaxation response at night when you can’t sleep. In fact, the relaxation response is so, well, relaxing that your daytime practice should be done sitting up or moving (as in yoga or tai chi) so as to avoid nodding off.

Step 1: Choose a calming focus. Good examples are your breath, a sound (“Om”), a short prayer, a positive word (such as “relax” or “peace”), or a phrase (“breathing in calm, breathing out tension”; “I am relaxed”). If you choose a sound, repeat it aloud or silently as you inhale or exhale.

Step 2: Let go and relax. Don’t worry about how you’re doing. When you notice your mind has wandered, simply take a deep breath or say to yourself “thinking, thinking” and gently return your attention to your chosen focus.