What can be done if anxiety doesn't let you sleep?

Hey. I have been having very serious sleep issues. I lie on my bed tired and drowsy but cannot fall asleep for 5-6 hours. My mind keeps racing with thoughts that just won't stop, the most intrusive of which are that I'll have to wake up early in the morning and be sleep deprived yet again.
I've tried following every suggestion out there, of getting sunlight in the mornings to boost melatonin, of having a nighttime routine devoid of stress and screens, to working out during the day to be sufficiently tired, eating a balanced healthy meal. I also don't have any external source of too much stress. But, it seems the sleep issues are still mental rather than physical, since there are a few unplanned days when I've slept just fine. I've just gone through multiple changes in my life at once recently. Shifted homes, jobs and got married. But my life is otherwise currently pleasant, but for these sleep issues. Please help me deal with this. It's quite distressing to lay in bed and witness night turning into day in front of my eyes while being tired. I have started to dread getting into bed.
Asked by Sleep Deprived

In your case the best way to overcome and deal with this bout of sleep deprivation or disorder you are struggling with is by treating the problem at the exact moments in which it is happening; those hours you lie in bed wondering. You can do this by using one or both parts of this activity I will outline for you to follow on the way to achieving better sleeping habits and longer sleep time. The first part of this activity or treatment approach is physical; please remember, do not attempt any physical activity or exercise unless you are cleared by your medical doctor or a licensed physician to do so and also to stretch and warm-up properly prior to starting any physical routine, and the second part is one or a series of mental exercise. The key to achieving success while using this method is by staying focused on the routine and not allowing your mind to wonder aimlessly about while attempting to fall asleep. You must be willing to invest the time and effort needed and not just try it one time then say it does not or won't work for you as your dedication and commitment to the process are also very intricate in making this work now and overtime. So let us begin your journey to falling asleep faster, sleeping longer and waking up more refresh and alert. When you are ready to go to bed begin by doing a physical activity you are comfortable with until becoming exhausted without overexerting yourself. Aim for at least three repetitions then lie down, inhale and exhale slowly in and out for about three seconds each breath until you begin to breathe naturally. Follow this by doing one or a series of the mental exercise; any of these can be counting from one to a hundred, reciting a poem or quote, narrating a story; fictional or otherwise, or reliving a specific pleasurable moment. Don't worry about time as you will eventually fall asleep just continue until you get the urge to begin again from step one. Please don't forget that I recommend you skip the physical activity part if you're not fit enough, recovering from injuries or medically cleared to do so. Practice this repeatedly until you begin to fall asleep without effort.