I spent years trying to crack my sleep issues. Blackout curtains, magnesium malate / citrate, no electronic devices for an hour before bed, CBD oil, even stronger CBD oil, different doses of Melatonin, 5-HTP, valerian extract, sleep apnea tests.
It never really significantly occured to me that it would be coffee as I believed I had ruled this out. I was already stopping coffee at 12pm and tried to limit to two cups. I also enjoyed coffee a lot, I spent good money on artisan roasted beans, a grinder and an aeropress (including one for travelling). Coffee is good for you right, antioxidants etc! Everyone drinks coffee and I can get it anywhere 24/7.
I decided it must be worth trying to drop it as an elimination test to see if it might help. I came across a reddit comment from a google search, where someone had quit caffeine and had a lot of success.
First few attempts failed, but eventually managed to get a day one out of the way (the stuff is addictive).
First 3-4 days were tough to put it mildly, constant pumping headaches and extreme fatigue. However around day 5 something wonderful happened. I had one of the most deep satisfying sleeps I had in years, it was like the sort of sleep a child has. Deep R.E.M level sleep with a vivid dream. I work up with a feeling of being deeply nourished. I actually cried as I was so happy I had found an answer.
I am now caffeine free for 10 months and I can still feel myself healing and the layers of the onion being peeled away. I very rarely get anxious now and my productivity at work is back at where it was when drinking coffee, but the difference is my focus is much better. On coffee I was like a scatter gun, whereas now it's more of a less manic focus.
I continue to sleep great, all night, no more 3 am wake ups. On the rare occasion that I do wake, I don't find myself in this delirium / anxious state where I proceed to toss and turn, instead I feel really at ease and drop off again.
Caffeine really gets played down as harmless (and perhaps for some it may be), but there are so many folks around that are suffering with sleep issues that could solve this by quitting. Caffeine binds to your adenosine-receptors. When adenosine binds to its receptors, neural activity slows down, and you feel sleepy. Adenosine facilitates sleep and dilates the blood vessels, probably to ensure good oxygenation during sleep. Caffeine blocks these receptors thereby removing the feeling of being sleepy. Studies are limited, but I wonder if the long term impact of playing with your biochemistry day after day for years has a bigger impact than we know of. It also increases cortisol the stress hormone, so this is where the anxiety comes from, cortisol is akin to 'fight or flight'.