Ambien (generic name: zolpidem) is a prescription medication used to treat insomnia. It belongs to a class of medications called sedative-hypnotics, which work by slowing down brain activity to help you fall asleep. Ambien is primarily prescribed for the short-term treatment of insomnia, especially for those who have trouble falling asleep. Ambien Designed to help you fall asleep and stay asleep. These are also taken once a night just before bedtime. It is Typically taken once a night just before bedtime.