Ambien, also known by its generic name zolpidem, is a sedative-hypnotic medication primarily used to treat insomnia. It is classified as a non-benzodiazepine sleep aid and works by affecting the chemicals in the brain that may be unbalanced in people with sleep problems.