I’ve had sleep issues ever since I was a little kid. I’ve done six sleep studies over the course of two decades and learned something new every time. Before I add anything, if this is regular and persistent, talk to a doctor before taking any advice.
I’ll chime in and back up what Eightbitsamurai and Sid said. Consistency, light discipline, chemical balance, and exercise (if you’re able to) are key.
Consistency: As above, wake up and go to bed at the same time every day. Every day. Don’t watch tv, read, or game in bed. A doctor once told me that the bed is for two things only: Sleeping and [you can figure out this one on your own].
Light Discipline: As above, avoid all screens an hour before bed. Also make your room as dark as possible. Blackout any indicator LEDs or other lights. Get blackout curtains. Get a sleep mask. We didn’t have abundant artificial light until just a couple hundred years ago, and we’re not made to deal with it.
Chemical Balance: Keep your body and brain clean. Avoid caffeine, sugar, alcohol and drugs. (Medical marijuana might serve as a sleep aid but there’s not enough clinical study to support that.)
Being able to sleep basically comes down to your brain chemistry and if your brain is ready to put your body to sleep. Melatonin (time-release) can be a helpful, natural sleep aid. Also consider Niacinamide (vitamin B3), GABA, and oleamide (natural oleic acid). Again, talk to your doctor.
Trouble sleeping can also be signs of other brain chemistry related issues like anxiety and depression, which can be treated with an SSRI. Again, talk to your doctor.
Exercise: Exercise basically comes back to brain and body chemistry. When you exercise your body goes to work to replenish what you’ve expended which usually comes with a light dusting of endorphins. There’s also something to be said for being just physically tired. Not everyone is physically capable of vigorous exercise, so it’s not a one-size-fits-all fix.
As for getting back on schedule, my personal method is just to stay up until your next regular bed time. This sucks and isn’t a healthy option for everyone, but if I get out of sync, my best bet is to stay up the additional 16-20 hours and go to bed when I normally would.