Ambien is a brand name for the drug zolpidem which is a medicational drug. The drug class for the same is sedative and hypnotics. They work on the central nervous system to help a person sleep. As the drug is a sedative, it works on the central nervous system and balances brain chemicals. So, it decreases overactive or unusual brain activity. This provides relaxation to the brain and helps induce sleep.
After taking the drug, a person is able to sleep peacefully for a long time. So, Ambien is used to treat sleeping problems like Insomnia and others. However, it is a sleeping pill so doctors prescribe it when other methods do not work. Therefore, before giving the treatment to you, your doctor may prescribe you therapies like CBT, or behavioral therapy. Also, you may need to change your lifestyle and sleep hygiene before the medicinal treatment.