Ambien, also known by its generic name zolpidem, is a prescription medication primarily used to treat insomnia, a common sleep disorder characterized by difficulty falling asleep or staying asleep. Ambien is prescribed to help individuals with insomnia fall asleep faster and stay asleep longer. It belongs to a class of drugs called sedative-hypnotics, which work by slowing down brain activity to induce sleep.