Insomnia is characterized by difficulty getting to sleep or staying asleep, and is very common for both healthy people or people having medical problems.
Sleeping pills are one of the ways to treat insomnia. Modern drug treatments for insomnia typically fall into two broad categories: benzodiazepines and nonbenzodiazepines. Ambien, the brand name for the generic drug zolpidem, is a nonbenzodiazepine sleep medication.
Xanax, the brand name for generic alprazolam, is a benzodiazepine approved by the U.S. Food and Drug Administration (FDA) for anxiety, but it is also used by many people for insomnia. Ambien and Xanax share a number of features, but they are also unique, however they are both very popular treatments for insomnia.