I’m a big believer in a regular writing schedule. Find a time of day that works best for you, carve that time out, and affix yourself to a chair and get it done. It’s not always easy or fun, but that’s how one gets it done.
Now, fortunately, so far, I’ve not had much of a problem with deadlines. The Thorn of Dentonhill and A Murder of Mages were essentially complete manuscripts when they sold. Editing work was required, but the time I was given to get that done was ample. On top of that, as soon as I signed the Thorn contract I started to put my nose to the grindstone on Thorn II.
That doesn’t mean I’m immune to things blowing up in my face. A disruption to my life can throw everything out of sync. A few weeks ago my wife was in a car accident. Fortunately her injuries were relatively minor, but the car was totaled. So the process of dealing with things like insurance, car rental, and so forth is time and energy out of my day, and that has to come from somewhere, and “somewhere” more often than not turns out to be writing. Or sleep. Or the dishes pile up. Those last two tend to come to a head far sooner than the writing, though.
Since my deadlines are relatively self-imposed at this point (i.e., when I want to get something done is sooner than other people are asking for it), getting back on track is mostly a matter of readjusting my expectations and going back to the grind. I’ve learned from experience that trying to do things like double my output or “catch up” usually results in things going even further off the rails.
Not to be all tortoise-and-the-hare, but slow and steady, getting back on task and doing the work each day is really the only thing you can do. But it does help that my personal deadlines give me enough breathing room to account for things going wrong.