Taking a melatonin supplement when you first get on a flight— if traveling overnight—is a great way to ease yourself to sleep, so you wake up refreshed and rested when you land. However, this should only be done for flights longer than 6 hours, as this is how long it takes melatonin to leave your system.