Sleeping pills treat insomnia by making you feel drowsy and relaxed. Sleep aids, including natural ones like melatonin, can cause side effects. You may feel confused or sleepy during the day. Some people walk or eat in their sleep (parasomnia). Other nondrug therapies like cognitive behavioral therapy (CBT) are better at improving sleep. As the name suggests, sleeping pills help you catch some sleep. People who have sleep disorders like insomnia may take these medications to help them fall asleep. Sleeping medicines can also help you stay asleep if you’re prone to waking up in the middle of the night.