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.
Exercise helps with the relaxed part.