Melatonin is a hormone secreted by the pineal gland. That’s a pea-sized gland found just above the middle of your brain and plays a vital role in your sleeping pattern.Generally, the body makes added melatonin during night. People use the melatonin supplement when they have insomnia. It also supports mental health.