Ambien, also known by its generic name zolpidem, is a medication primarily used for the short-term treatment of insomnia, or difficulty sleeping. It belongs to a class of drugs called sedative-hypnotics, which work by slowing down brain activity to help induce sleep. Ambien is typically prescribed for individuals who have trouble falling asleep or staying asleep through the night.