Melatonin is a hormone produced in the pineal gland at the base of the brain. We can also get it in supplements. When light hits our eyes, we shut down melatonin production; when it’s dark out, we start making it again. Melatonin synchronizes our wake-sleep cycles to the cycles of light and dark/night and day. It tells us when to sleep.
Melatonin is what biologists call “highly conserved,” meaning that even as species have evolved, the gene for melatonin has not.