They don't call 'em deadlines for nothing. I'm pretty sure it's because most of us feel half dead when we get there. But if you plan ahead and work steadily, you can reach your deadline (real or self-imposed) with some measure of sanity. Every writer had their own method, but here's what I do to stay on top of mine--I haven't missed one yet:
1. Break down the task.
A book is a huge project. Figure out how many pages (or words) you need to write a day to get your ms. finished by deadline. My quota is 6 quality pages per day (I edit as I write). Do the math--if I can do it, anyone can. Desired Page Count divided by Pages Per Day= how many days you need to write for your first draft. (For me: 350 pgs divided by 6= 59 writing days.)
2. Mark it down.
Print out a calendar of your writing months and checkmark the days you will write your daily quota. Don't check the days you don't plan on writing (vacation/weekends/etc).
3. Add wiggle room.
Add a few extra weeks between now and your deadline for life to happen. It will. It also leaves room for when you get stuck and need to spend your writing time fixing plot problems. This brings my writing time up to 80 days.
4. Add time for rewrites
. I like to have a month for rewrites. This brings my writing time to a total of 110 days.
5. Stay accountable.
Chart how many pages (or word count) you wrote each day on your calendar and tally up the end of each week. If you fall short one day, try to make it up by the end of the week. If you fall off track a bit, redo the math about 1/2 way through your WIP and adjust your calendar (or daily quota) as necessary.
You can see my sample calendar above for last month. Some days I didn't meet my quota because I was working to fix plot problems on those days. I'm 3/4 through my 1st draft, and I still have a week's wiggle room left. Plus my hubby gave me a spa day for our anniversary, and I was able to take a whole day off guilt-free. :)