This is what works best for me when I need to get up. I have the problem that there are always a million more things I want to do before I go to bed. If I let myself do them I will be wide awake and focused until I hit a wall and have to go to bed, but this time will be about 2 hours after I should I have gone to bed and the next day I'll be terribly groggy if I get up at the normal time.
The most important thing for me is not giving in to staying up late. My brain wants to do it, but I have to say no.
For me the night-time is the only quiet time to get work done (full-time job, family), but I still need to get up about 5:40 AM. I aim to get to sleep by 10:30 but usually work up until that point. I know I sometimes suffer when trying to fall to sleep, but I guess it's a trade-off I'm willing to make.
The most important thing for me is not giving in to staying up late. My brain wants to do it, but I have to say no.