This medication is used to treat a certain sleep problem (insomnia). It may help you fall asleep faster, stay asleep longer, and lessen how often you wake up during the night, so you can get a better night's rest. Eszopiclone belongs to a class of drugs called sedative-hypnotics. It acts on your brain to produce a calming effect.