About one in four adults in the United States develop symptoms of insomnia each year. In most cases, these are short-lived, caused by things like stress or illness. But one in 10 adults are estimated to have chronic insomnia, which means difficulty falling or staying asleep at least three times a week for three months or longer.

Sleep deprivation doesn’t just create physical health problems, it can also harm our minds. A recent poll from the National Sleep Foundation, for example, found a link between poor sleep health and depressive symptoms. In addition, studies have shown that a lack of sleep can lead otherwise healthy people to experience anxiety and distress. Fortunately, there is a well-studied and proven treatment for insomnia that generally works in eight sessions or less: cognitive behavioral therapy for insomnia, or C.B.T.-I.

If you cannot find a provider, C.B.T.-I. instruction is easy to access online. Yet it is rarely the first thing people try, said Aric Prather, a sleep researcher at the University of California, San Francisco, who treats patients with insomnia.

Instead, they often turn to medication. According to a 2020 survey from the Centers for Disease Control, more than 8 percent of adults reported taking sleep medication every day or most days to help them fall or stay asleep.

Studies have found that C.B.T.-I. is as effective as using sleep medications in the short term and more effective in the long term. Clinical trial data suggests that as many as 80 percent of the people who try C.B.T.-I. see improvements in their sleep and most patients find relief in four to eight sessions, even if they have had insomnia for decades, said Philip Gehrman, the director of the Sleep, Neurobiology and Psychopathology lab at the University of Pennsylvania.

Sleep aids can carry risks, especially for older people, who may experience problems like falls, memory issues or confusion as a result of using the medication. C.B.T.-I., on the other hand, is considered safe for adults of any age. It can even be adapted for use in children.

Many people mistakenly assume that C.B.T.-I. is entirely focused on sleep hygiene — the routines and environment that are conducive to good sleep, said Shelby Harris, a psychologist with a private practice in the New York City area who specializes in C.B.T.-I.

C.B.T.-I. does use a series of treatments to target behaviors that are inhibiting sleep, like daytime naps or using digital devices before bed, and replaces them with more effective ones, like sticking to a consistent wake time. But it also aims to address anxieties and negative beliefs about sleep.

Much of the time, insomnia can lead to the feeling that sleep has become “unpredictable and broken,” Dr. Prather said. “Every day people with chronic insomnia are thinking about ‘How am I going to sleep tonight?’”

C.B.T.-I. teaches people different ways to relax, like deep breathing and mindfulness meditation, and helps patients develop realistic expectations about their sleep habits.

It is especially important that people with insomnia learn to view their bed as a place for restful sleep rather than associating it with tossing and turning. Patients undergoing C.B.T.-I. are asked to get out of bed if they are not asleep after around 20 or 30 minutes and do a quiet activity in dim lighting that doesn’t involve electronics. In addition, they are told to stay in bed only while drowsy or sleeping.

“C.B.T.-I. leads to more consolidated sleep and shorter time to fall asleep which is a major gain for many,” Dr. Harris said.

If you’re having problems sleeping, first visit your health care provider to rule out any physical problems (like a thyroid imbalance, chronic pain or sleep apnea) or a psychological issue such as depression that might require separate treatment, the experts said.

You can search for a provider who is a member of the Society of Behavioral Sleep Medicine or use the Penn International CBT-I Provider Directory. Your primary care doctor may also provide a referral. If you’re using a general online therapist directory like Psychology Today, be wary of those who claim to offer insomnia treatment but do not have specific training in C.B.T.-I., Dr. Harris warned.

Finding someone who specializes in C.B.T.-I. may prove difficult — especially one who takes insurance — because there are fewer than 700 clinicians trained in behavioral sleep medicine in the United States. And one 2016 study found they are unevenly distributed: 58 percent of these providers practicing in 12 states. The clinic where Dr. Prather works, for example, has hundreds of people on its waiting list.

A review of clinical trials found that self-directed online C.B.T.-I. programs were just as effective as face-to-face C.B.T.-I. counseling. If you are self-motivated, there are several low-cost or free resources that can teach you the main principles.

One option is the five-week program Conquering Insomnia, which ranges in price from about $50 for a PDF guide to $70 for a version that includes audio relaxation techniques and feedback about your sleep diary from Dr. Gregg D. Jacobs, the sleep and insomnia expert who developed the program.

You can also check out Insomnia Coach, a free app created by the U.S. Department of Veterans Affairs that can be used by anyone. It offers a guided, weekly training plan to help you track and improve sleep; tips for sleeping; an interactive sleep diary; and personal feedback.

Sleepio is another reputable app, Dr. Harris said. There are also free online resources from the A.A.S.M. and educational handouts from the National Institutes of Health, which include a sample sleep diary and a guide to healthy sleep.

And for those who prefer to avoid technology entirely, more than one expert recommended the workbook “Quiet Your Mind and Get to Sleep” by Colleen E. Carney and Rachel Manber.