Melatonin is a hormone the body makes naturally to signal that it is time to sleep. As a supplement or medicine it can be helpful for specific situations, particularly jet lag, shift work, and delayed sleep timing, and in some people over a certain age for short-term insomnia. It tends to be more useful for resetting the timing of sleep than as a general sleeping pill.
Its legal status differs by region. In the UK and much of Europe it is a prescription medicine, while in the US and Canada it is often sold as an over-the-counter supplement, where product quality and dosing can vary. Short-term use is generally considered safe for most adults, with possible side effects including headache, daytime drowsiness, and vivid dreams.
Because melatonin can interact with other medicines and may not be suitable in pregnancy, for children, or with certain conditions, it is best to check with a pharmacist or doctor before using it, rather than self-prescribing. They can advise on whether it is appropriate, the right timing, and how long to use it.