Oh boy.
First of all, form good “sleep hygiene” habits, read: https://health.arizona.edu/sites/default/files/data/Sleep Hygiene.pdf
A lot of it is obvious, like go to bed at the same time every night (set a timer to get yourself reliable at first!), and wake up at the same time every morning. Give yourself more “sleep opportunity” than the hours you want to sleep so you actually get enough sleep (e.g. if you want to sleep 8 hours, maybe give yourself 10 hours in bed with the lights out).
Don’t use screens several hours before bed, don’t do anything but sleep in your bed, and wind-down before bed with something like reading a book (again, in a chair in another room, not in your bed).
Now for more advanced tips I’ve learned from dealing with insomnia:
A problem I have sometimes had is that tasks like meditation can actually cause me to become more alert, and it turns out meditation actually does cause insomnia.
When struggling with meditation related insomnia, I got lots of practice navigating falling asleep.
What I found most helpful was rather than focusing on an object in a meditation like way, to instead allow mind-wandering and rumination and to try to cultivate a lack of metacognitive awareness about that rumination. Basically, the opposite of meditation. Meditators will hopefully know what I mean by this - but basically, don’t pay too much attention to what you are thinking, just get absorbed into the mind-wandering.
Sometimes if the mind-wandering leads to thoughts or feelings that are “strong” or engaging enough it can prevent me from sleeping, like when I’m anxious or my mind is preparing or rehearsing for an important event or the next day. In that case, a little bit of meta-awareness can be helpful to alert you to the need to redirect your rumination to something actively boring or benign.
In the most extreme instances, I visualize myself working in a factory performing a repetitive motion like pulling a level to operate a press. I essentially constantly try to pay attention to that mundane task and ensure that it remains mundane / uninteresting - just keep pulling the lever and keep paying attention to that task. This is akin to the counting sheep method, but I always found counting sheep too interesting or engaging of a task.
After hours of boredom I usually lose consciousness.
Sometimes I threaten myself with getting out of bed, and often in response I feel a resistance and that makes me realize how tired I actually am, and I threaten myself with doing something boring like sitting in a chair and staring at a wall. Sometimes that is enough to kick me out of my energized thinking into a milder / more boring and repetitive mind-wandering that leads to dreams and unconsciousness.
Sometimes I actually do have to get out of bed and do something, often I will stretch and if I’m not feeling overwhelmed with sleep that way, I find it helpful to exhaust myself with forearm planks - just hold until you can’t anymore (you can also use a timer for 30 seconds or 60 seconds, whatever pushes you past comfort but all the way to failure), maybe try this a couple times. You will sweat and it’s miserable the whole time, and you will be tired and want to crawl back into bed. That has helped me fall asleep really well before, and sometimes I think it’s because the blood also gets into my muscles and somehow this helps me relax.
Anyway, hope this helps!
Do nothing but sleep in the bed?
Oh, 'cmon!
My wife won’t be happy about that.
She really likes to cuddle and play with the cat in there