
IMPORTANT: this is health content about a clinical condition, published by a company that sells sleep products. So the honest position first — the most effective treatment for chronic insomnia is not a product, and it is not sold here.
Insomnia is difficulty falling asleep, staying asleep, or waking too early, with daytime consequences. When it occurs at least three nights a week for three months or more, it is chronic insomnia and it is a diagnosable condition.
Several things get called insomnia that are not, and they have different treatments:
Insufficient sleep opportunity — going to bed at 1am and waking at 6am is not insomnia, it is not enough time in bed
Circadian misalignment — falling asleep at 3am naturally and sleeping well until 11am is delayed sleep phase, not insomnia
Sleep apnoea — falling asleep easily but waking unrefreshed, often with snoring. Common in India and badly under-diagnosed.
Restless legs — an urge to move preventing sleep onset
Sleep disruption from an underlying condition, medication, pain or substances
Getting this distinction right matters, because treating apnoea with melatonin will not work.

Cognitive behavioural therapy for insomnia is recommended as first-line treatment for chronic insomnia across multiple clinical guidelines, ahead of medication.
It works because chronic insomnia is largely maintained by learned associations and behaviours — the bed becoming a place of anxiety, compensatory napping, spending excessive time in bed awake.
Sleep restriction — deliberately limiting time in bed to consolidate sleep, then extending gradually
Stimulus control — using the bed only for sleep, and getting up if awake beyond about 20 minutes
Cognitive work on sleep-related anxiety and catastrophic thinking
Sleep hygiene education, which is a component rather than the whole treatment
Relaxation techniques
Its benefits persist after treatment ends, which is not true of sleep medication. In India it remains significantly under-used — ask for it by name.

Honestly and narrowly.
Melatonin helps when the problem is circadian timing rather than insomnia itself — jet lag, shift work, delayed sleep phase
Magnesium may help if your intake is low, gradually and modestly, and does nothing if it is adequate
Neither treats chronic insomnia, and neither is a substitute for CBT-I
If you have been cycling through sleep supplements for a year without resolution, that is a strong signal the problem is not one a supplement addresses.
Prescription sleep medication has a role: short-term use, under medical supervision, usually for acute severe insomnia.
It is not a long-term solution by design. Tolerance and dependence are documented risks, and stopping can produce rebound insomnia worse than the original problem.
This is a decision for you and your doctor. Never start, stop or adjust prescription medication based on an article.
What you can do starting tonight
Fix your wake time first and keep it constant, including weekends. This anchors everything else.
Get bright light within an hour of waking
Reduce bright and blue-heavy light in the two to three hours before bed
Get out of bed if you are awake beyond about 20 minutes, and return when sleepy
Stop compensatory napping and lie-ins, which reduce sleep pressure
Cut caffeine after mid-afternoon
Reduce alcohol, which fragments the second half of the night
Keep the bedroom cool, dark and quiet
These overlap heavily with CBT-I components and are a reasonable starting point while you seek proper support.

Difficulty sleeping at least three nights a week for three months or more
Daytime impairment affecting work, driving or safety
Loud snoring, witnessed breathing pauses, or waking gasping
Low mood, anxiety or hopelessness alongside the sleep problem
Sleep difficulty that started with a new medication
Any reliance on alcohol or sedatives to sleep
Insomnia frequently occurs alongside depression and anxiety, and treating one without the other rarely resolves either. If your sleep problem sits alongside persistent low mood, please raise both with a doctor.
This article is for general information and is not medical advice. Chronic insomnia warrants assessment by a qualified doctor.