Lots of riding helps. So does getting off the computer, phone or TV and reading a book for a hour before bedtime. I've tried CBD and it seems to help for times I might have anxiety. But no miracle, and Benadryl (diphenhydramine) seems to work just as well for those times. And is way less expensive. Melatonin in doses higher than 3 mg makes me jittery before bed though I do fall asleep fast. But with those high doses, I also seem to wake up at 2:00AM on the dot and can't fall back asleep without at least an hour of tossing and turning.
Out of it all, the long rides and reading seems to help the most. I suppose working out in a gym would work just as well as the riding. But I have trouble getting interested in going to the gym more so than I have getting on my bike. Which sometimes I have to force myself to force myself to get on the bike. But I've never regretted it once I start to pedal.
I guess it's a old age thing. I use to always fall asleep quickly and soundly up until about my late 50's.