Melatonin is one of the safest sleep aids available over the counter. Prescription medication ramelteon mimics melatonin’s effects. It’s not habit-forming, and it has no effect on sleep or mood, as melatonin does.