Zolpidem is used to treat insomnia (difficulty falling asleep or staying asleep). Zolpidem belongs to a class of medications called sedative-hypnotics. It works by slowing activity in the brain to allow sleep. Zolpidem will work faster if it is not taken with a meal or immediately after a meal. Follow the directions on your prescription label carefully, and ask your doctor or pharmacist to explain any part you do not understand. Use zolpidem exactly as directed.