Had 30 years of insomnia. It was literally hell.
I fixed it in 3 years and it stayed fixed.
I stopped eating sugar. zero sugar in food, no sweat drinks no candy. And I didn't replace it with some sugar free stuff.
It took 3 days and then I started to sleep really good.
After 2 years I started to eat some sugar again. Still do but I am a little bit mindful about it. That is all.