I've fluctuated between being able to sleep easily and being unable to go to bed.

In the end the issue has always been satisfaction. If I feel satisfied at the end of the day, there's no resistance to sleep. If I am "missing" something to satisfy me, I follow that craving and keep myself up far too late. Sometimes that's stimulation, sometimes it's entertainment, sometimes it's relaxation.

Meditation 'cures' the issue for me too, but not really. The issue is that when I am in the state that keeps me from being able to sleep, I tend to put off trying to meditate, in the same way I put off going to bed. It helps, but the root of it is finding balance in my day.

Even through meditation if certain mental needs aren't being met, my mind will get forced off track. Sometimes I need more creative stimulation, sometimes I need to get lost in a good story, sometimes I just need to space out and let some background processes clean up.

My best sleep and wake cycle happened when I had a bit of a mental (hormonal?) boost after my daughter was born. It seems a bit funny, because most people complain about how they lose sleep with the baby needing to be fed etc. But for about 6 months everything just felt right, and at 9 or 10 PM or whatever, going to bed just felt right, like there wasn't anything else in the day that I wished that I could do. I'd wake up after getting enough sleep without an alarm at 6:30 or so, and my daughter was sleeping through the night.

Now that ultimate satisfaction feeling has kind of worn off, my daughter is 2, is pretty demanding of my time, and when I get home from work it's a constant stream of doing things for other people without an opportunity to attend to my own needs. Forcing myself to go to sleep at 9 more than a couple of days in a row becomes impossible just because by that point my body just says "Fuck you, you aren't sleeping, you have things I need you to do. Fun things. Or at least you better start looking for something fun."

And the more tired I am, the harsher that is. In general, my best successes come from getting enough rest in the first place. The more tired I am going into a day, the harder it is to feel satisfied by the end of it, and the harder it is to sleep.

To that end, I nap on the weekend to catch up on sleep. It's part of my schedule to the point that my wife expects it. No matter how rough the week is, by Saturday afternoon I'll probably have caught up.

The other thing I try to do is be cognizant of what I'm craving and feed that need. A lot of sort of wasted time can happen while you're frustrated that you want something but you're not sure what it is, or you avoid it for some reason. Maybe I've had an exhausting but not very mentally stimulating week and I've been playing a lot of video games. I might have previously tried to force myself to not play video games if I felt I was playing them too much, but that would lead to me procrastinating on anything else either, and then ultimately caving when it got late in the evening and playing anyways but playing too late. Now I might recognize that that's the kind of stimulation that I'm missing, and get it out of the way ASAP, which might be enough to let me get to bed a little earlier.

Waking up is easy when you actually sleep as much as your body wants, no alarm needed even. The real problem is getting to bed early enough that you consistently get to sleep as much as your body wants while still feeding those needs. If you have a mentally unsatisfying and draining day, and all you can do after you come home is cook, clean, and go to sleep in order to get enough sleep to get up for work the next day, you're going to find that soon you won't be able to sleep again, because your brain is kicking your ass for not meeting its needs.