Ambien was supposed to be our solution. The insomnia drug was originally approved by the F.D.A. in December 1992 under the name zolpidem and brought to market in the U.S. as Ambien by the French pharmaceutical giant Sanofi-Aventis.

It worked like a benzo (think Valium) but without benzodiazepine—the highly addictive downers people had been using to put themselves to sleep (and ease the monotony of being a 60s housewife) for decades. Ambien was safe. Effective. Subtle, even. Or at least, that’s how it was marketed. It was a wildly successful approach: tens of millions of prescriptions were written every year; Sanofi-Aventis grossed billions and billions.

Then a few years back, the Food and Drug Administration confirmed what many, many people already knew: Ambien can make you do some weird shit. In the spring of 2019, decades into its reign, the F.D.A. issued a boxed warning—its “most prominent” citation—declaring that “certain prescription insomnia medicines,” including zolpidem, carry “risk of serious injuries caused by sleepwalking.”

By now, even those who have never used Ambien have likely heard the horror stories. The author Ayelet Waldman once reported an “unfortunate stretch of Ambien intoxication during which she tried to enlist an actress to be a replacement wife for her husband in the event of her death.” The comedian Nikki Glaser has a whole bit about becoming intimate with a partner and forging such a deep emotional connection they impulsively book a vacation together, only to find out the Ambien-addled fellow doesn’t remember any of it: “We made plans to go to Mexico—this is Priceline, I can’t get a fucking refund!”

Because Ambien is so widely used and so well known, it’s hard to tell which Ambien stories are real and which are bluster. When accused of violating S.E.C. rules, Elon Musk blamed Ambien for his behavior. Roseanne Barr blamed Ambien after she sent a racist tweet. A friend of mine said she vowed never to take Ambien after watching an episode of Oprah on which a woman claimed to have eaten a whole stick of butter while on Ambien. This friend also readily admits this incident may be apocryphal. According to the Daily Mail, Rachel Uchitel once claimed that she and Tiger Woods used to regularly have “crazy Ambien sex.”

The F.D.A.’s boxed warning wasn’t really about all of the strange things that you might do on Ambien, though. Rather, the F.D.A. was warning about the physically dangerous things you might do. “Rare but serious injuries have happened with certain common prescription insomnia medicines because of sleep behaviors, including sleepwalking, sleep driving, and engaging in other activities while not fully awake,” the boxed warning stated. “These complex sleep behaviors have also resulted in deaths.”

In 2011, The Journal of the American Academy of Psychiatry and the Law published a paper titled “‘I Did What?’ Zolpidem and the Courts.” The authors explored real-world examples of legal cases prominently involving Ambien. A sampling:

—“Ms. Kelly was a police officer until her termination after improper conduct. After work one evening she took several tablets of zolpidem and deliberately remained awake to play video games. While intoxicated, she made several crank phone calls to police dispatch that included sexual innuendos and a false report of a fire behind her home.

—“Ms. Gibson sued Sanofi-Aventis for product liability when she had a car accident after taking zolpidem.... Ms. Gibson took zolpidem approximately 30 minutes to one hour before her accident. She had curlers in her hair and a mud mask on her face and was not wearing her glasses.

—“Around 11 p.m. one evening, Mr. Hudon was observed driving recklessly. A high-speed police chase ensued. After being cornered in a cul de sac, he resisted arrest and punched an officer in the face. He was taken to the hospital where his blood alcohol level was measured at 0.13.... He stated the last thing he remembered was taking 10 mg of zolpidem at 9:30 p.m. He had no recollection of drinking alcohol, the car chase, or treatment in the hospital.”

The bad press for Ambien may have contributed to some people ceasing to take pharmaceutical sleep aids altogether. Last summer, researchers at the Journal of Clinical Sleep Medicine released their findings from a study utilizing data from the National Health and Nutrition Examination Survey from 2013 to 2018, the most recent large dataset available. It suggested something remarkable: the absolute number of people using sleep medications had dropped by at least an estimated 2 million. As the humble sleep scientists put it: “To our knowledge, this is the first study to show a national decline in use of prescription medications for sleep disturbance.”

Choose your fighter: TikTok influencer versus Ambien prescription.

So if millions of people have stopped taking Ambien, how exactly are they falling asleep? There is no more monoculture answer. Many will tell you weed gummies. Some may suggest mattresses that cost tens of thousands of dollars and are made from the hair of “semi-wild yaks that roam on the mountains of the Khangai region of Mongolia.” Some doctors are excited about orexin-receptor antagonists, a newer class of medication that can deliver a similar impact with fewer side effects than Ambien.

On TikTok, I find someone advocating the “military sleep technique,” a medication-and-expense-free visualization option allegedly created by the U.S. Army. The TikTok account is @mindbrainbodylab. The TikToker’s name is Cody Isabel. On the phone from Kansas City, he tells me, “People don’t realize how important sleep is—your brain literally clears traumatic chemicals out of itself when you sleep.” I worry about being led astray by a micro-influencer. I wonder why I sought out answers on social media. Isabel’s thoughts seem (mostly) logical, but also heavily based on the premise that our prehistoric ancestors slept well.

His rules: no caffeine after 11 a.m. Keep a stress journal to jot your thoughts in if you have racing thoughts in the middle of the night. Try engaging in a dialogue with your own brain, which you should also name. Isabel calls his “Jerry,” as in “Jerry, what’s up man, how you doing, bro, talk to me, man: what are you afraid would happen if you let me fall asleep?”’

Establish a night routine. Isabel starts his routine 90 minutes before sleep. He turns as many lights off as possible, leaving only ones at feet level. Why the low lights? “When we were cavemen and cavewomen, we had to have campfires to see at nighttime. A fire meant it was time for bed. And fires were by our feet.”

As the 90-minute countdown begins, Isabel stops eating. He makes sure the bedroom is cold: 65 degrees or lower. He sleeps on his left side because he believes that doing so activates the parasympathetic nervous system to cleanse your brain of toxins most effectively. He gets his room so dark that he literally cannot see his own hand in front of his face. He says the bedroom should only be “for S.S.”: sleep and sex. “TV in your room? No bueno! Charging your phone near your head? Not good!”

And what about those still using Ambien occasionally? “I know how hard it is to get off sleep aids,” he says. “The withdrawal, the anxiety.... But it’s best not to use them.”

“Did cavemen have Ambien? Or cavewomen?” he asks.

For all of his quirky peculiarities, Isabel does seem to be aligned with the modern thinking on treating sleep disorders. Dr. Ali El Solh, a specialist in sleep medicine at the University at Buffalo, tells me the general approach is cognitive behavioral therapy, or C.B.T. “The intent is to re-align the sleeping cycle with your internal clock,” El Solh explains. To that end, El Solh tells patients: “Avoid all electronics, try to sleep in your room that has a little bit of a cool temperature, do not ruminate over thoughts that happened during the day.” Over six to eight weekly sessions, El Solh hopes to instill in his patients “the best sleep hygiene.” He’ll move on to a prescription for medication only if his main approach has failed for a patient. “Once you are on medications, it becomes very difficult to get off of them.”

Dr. Atul Malhotra is a sleep-medicine specialist at U.C. San Diego and one of the authors of the Journal of Clinical Sleep Medicine paper confirming that use of sleep medications has decreased. Malhotra is careful to point out that Ambien isn’t alone in its users reporting strange side effects and that, in part, that’s a factor of the drug’s popularity. “You look at any multi-billion-dollar drug, you’ll see these reports.” He says he urges people to avoid “fearmongering” around Ambien and similar medications. “I have plenty of patients who are on long-term sleeping pills.”

He does add that he once prescribed Ambien for his wife and that she experienced hallucinations. He laughs, “She never forgave me for that.”

Nevertheless, there are some out there who still swear by Ambien. Recently, a poster on a Reddit forum on insomnia wrote about her love for the old warhorse: “My doctor refuses to give me another prescription. They took me off months ago and I haven’t been able to sleep well since then. It takes me hours to fall asleep every night. They’re sending me to an insomnia specialist for [treatment]. Why? Ambien was working for me. If sleep is so important then give me what helps, for crying out loud!”

Amos Barshad is a Brooklyn-based writer