If you do hard physical exercise (weight lifting, forget running), until you are dead tired, and stop drinking stimulants (coffee et al) then you will have good sleep. So simple.
The best way to have a good sleep is to stop being anxious and depressed, forget bad things, stay happy, be relaxed at evening, have a good hormonal profile, eat healthy, have a strict circadian discipline, a loving partner and live a nice live in general.
It was like that for me, until it wasn't. I am still weight lifting but my sleep is much worse if I push too much. Sleep issues are simple only until you have them.
Exercise helps with the relaxed part.