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). When you take sleeping medicines night after night, your body may start to depend on them. When you stop the medicine, your insomnia may come back worse than before. Other nondrug therapies like cognitive behavioral therapy (CBT) may be better at improving your sleep.