Melatonin is a hormone produced in the body that regulates sleep cycles. It is produced in the pineal gland and levels rise at night in response to darkness. As a supplement, melatonin is used to treat sleep disorders like jet lag or shift work disorder by helping to realign the body's circadian rhythm. It may also help with sleep quality, headaches, and depression. While generally safe at low doses, melatonin can cause side effects like drowsiness if taken too close to bedtime or in high amounts.