Ambien, generically known as Zolpidem Zolpidem Hydrochloride, is a prescription compound primarily prescribed to treat difficulty sleeping. This quickly-acting hypnotic works by affecting certain receptors in the brain to induce sleep . It's typically given just before going to rest and is not advised for prolonged treatment .