A couple of things have helped me reel myself back to a more regular schedule. Melatonin is one, a natural sleep aid. The other was some personal self discovery that led me to the realization that I was using poor sleep habits as an excuse for failure. Not that I want to fail, but if I do, I have my dysfunctional sleep patterns to blame it on. Coming to terms with this has certainly helped me get closer to a more consistent sleep routine, though I'm not there yet. I am still working on creating pre-bed habits that will hopefully give me that Pavlovian response that it is time to sleep. Melatonin is helping with this strategy.
Another piece to my strategy is to write everything down. Every to do list item, every idea or thought I might want to save for later. If it's written down, then there is no use for it to be swimming around in my head at bed time, keeping me awake. Pre-bed journaling can help with this.
Everyone is unique when it comes to his/her relationship with sleep. I hope you find what you need to have a consistently restful sleep, so that you can make the most of the hours you are awake. That is my aim.