My best response was to correct, time released dosing of melatonin at the same time every day. It’s important to do all of the life changes needed - lights off or dim, warm light, very dim phone, reminders for the melatonin at the same time every day, etc.
I don't know about the melatonin (I don't like taking anything other than a multivitamin nutritional safety net), but, as bedtime approaches, I like a dim orange light, and to use color temperature changing software/settings on screens. http://jonls.dk/redshift/
The funny thing is you do still take vitamins in your diet through “functional foods.”
Another trick that might help someone for those nights where your brain races too much to sleep: get out of bed and write down all the thoughts you’re having with a pen/pencil and paper. Avoid a computer screen since the light really will keep you up and energized.
I mostly solved my sleeping issue after many years of trial and error by having a speaker by the bed and then on low volume play a podcast that's interesting enough to listen to but not interesting enough to keep me engaged. This helps me by keeping my mind focused on something unimportant instead of racing around, when I inevitably try to focus on something else it's drowned out by the podcast.
> then on low volume play a podcast that's interesting enough to listen to but not interesting enough to keep me engaged
I tell anyone who will listen about the podcast "Sleep with Me." Scooter is a master of being just-interesting-enough but in a very soothing voice. For all I know he's hypnotizing me every night because I'm always able to fall asleep long before the episode is over.
Music or a podcast like this has always worked really well to solve insomnia issues for me. Unfortunately it led me to discover a new issue - when I fall asleep listening to anything, even on low volume, there's a really good chance I'll sleep through my alarm(s) in the morning.