The root cause of insomnia is a mix of poor sleep habits like an irregular sleep schedule, using screens like phones in bed, psychological factors like depression, anxiety, stress and other worries and even medical conditions like thyroid issues, asthma, chronic pain etc.
Even life changes including new jobs, jet lag, medications and genetics also cause insomnia and create a cycle in which worrying about sleep makes the sleep worse.
Insomnia is a disruption in your brain's sleep and wake cycle system, which is triggered by a combination of these mental, physical and lifestyle elements and issues, which make it hard to fall asleep or stay asleep.
In some cases the body may not be producing enough melatonin like it normally should and sometimes taking some melatonin supplements to increase the melatonin in the body can help you fall asleep and stay asleep.
Melatonin is also naturally made in the body and sometimes you might need supplemental melatonin when the body is not producing enough of it for you to sleep properly.
The body naturally produces melatonin in the pineal gland, which is a tiny brain structure that the melatonin is made in at night in response to darkness to regulate your sleep and wake cycle or circadian rhythm.
Light suppresses the production of melatonin in the pineal gland and low light and darkness trigger the release of melatonin which signals the body to prepare for rest, with levels of the melatonin peaking in the middle of the night.
The melatonin production process involves light sensing, signal to the Pineal gland, synthesis, release and circadian rhythm.
The eyes detect light and send signals to a part of the brain called the suprachiasmatic nucleus, which is your internal clock.
During the day, the light tells the suprachiasmatic nucleus to stop melatonin production, and then as darkness falls, the suprachiasmatic nucleus signals your pineal gland to start making melatonin again.
The pineal gland synthesizes the melatonin from the amino acid tryptophan.
Melatonin is then released into your bloodstream and cerebrospinal fluid and acts as a chemical messenger, which tells the body that it's time to relax and get ready to sleep.
The process creates a daily rhythm, with high melatonin at night and low levels of melatonin during the day, which helps the body maintain it's sleep and wake cycle.
Darkness is essential for triggering the production of melatonin, and longer nights like in the winter can increase the melatonin secretion.
And bright light, especially before bed can significantly inhibit the melatonin release.