Here are some things I have done when I have been unable to fall asleep.
First, some conventional advice:
Engage in physical activity earlier in the day. Go for a walk.
Avoid stimulants some hours before going to bed, including sugars and caffeine. Even better, avoid it completely.
Turn off all screens about an hour before going to bed. Read a book or go for a walk instead.
Touch can be relaxing. Give or receive nurturing touch, massage etc. before going to bed.
Turn off your phone and leave it in another room.
Write your worrying thoughts down before going to bed. This gets them out of the mind and onto paper.
And some more:
Take care of stressful things in your life.
Do grounding and body-centered activities such as yoga, tai chi, or Breema.. Go for walks in nature. Do gardening.
Inquire into stressful thoughts.
Train a more stable attention, for instance by bringing attention to the sensations of the breath.
While in bed, and before falling asleep:
Count backwards from 100 in steps of three.
Bring attention to the sensations of the breath, for instance in the nostrils.
Feel sensations in the body. Notice and allow any tension or contractions. Notice the space around and within it. Notice any words or images. Notice them as words and images.
If you notice your mind spins off into thought (stressful or otherwise), ask yourself: What would I have to feel now if my mind didn’t go to these thoughts? Feel that. See how it is to notice and allow it (including any words or images that are there). Do the same with any impulse to look at a screen, eat comfort food, etc. Explore what it is that you don’t want to feel, and see how it is to notice and allow it, and feel it.
Do tonglen, ho’oponopono, heart prayer. You can even do ho’oponopono towards the sleeplessness, and any stressful reactions you have to it.
Try the Taoist inner smile: Smile at each of your organs in turn, starting at the head and moving down.
Ask yourself: It’s terrible if I don’t sleep now, is it true? Is it true I won’t function tomorrow?
And if you have stressful thoughts or experiences, ask yourself: Is it true this experience is overwhelming? Is it true it’s too much? Is it true it means something terrible will happen? (Or has happened? Or is happening?)
In general, if you fight sleeplessness it’s more likely to hang around. Notice it, allow it. And do something that’s relaxing while requiring you to stay awake (counting backwards, ho’oponopono etc.), which may allow sleep in.
Also, sleeplessness is a great opportunity to do inquiry, train a more stable attention, do tonglen or ho’oponopono or the heart prayer, or any other exploration or practice.
Take any of these ideas as an experiment. See what works for you.
Also, ask yourself: What’s the threat in not doing a certain thing? (E.g. using screens before going to bed.) What’s the threat in doing a certain thing? (E.g. Feeling the sensations.)
You can also try melatonin, for instance a combination of slow release and quick release. (Smaller amounts sometimes work better, at least for me.)