I don't think you really need specialized advice on how to produce a book in four years. Year 1: Do a lot of research and write 1/3 of the book. Year 2: Do a lot of research and write the second third of the book. Year 3: Send out proposals, do final bits of research, write the final third of the book, polish. Year 4: Submit manuscript, revise according to reviewer comments, submit final copy, do proofs and index, published version comes out. Adjust timescales as necessary, but not in the direction of "take longer writing."
- I would say that it can be helpful to count back, and so the first thing you need to know, is whether the book must actually be out, or in press, or just accepted. The answer to that question changes how many years you have.
In my experience (quite a few books, some single-authored, some edited), it takes about a year from the submission of the final version, to the actual publication.
So, that calculation tells you when it has to be really, really done - as in, there is nothing more for you to do. And then, yes, you can think about how to write it, in the time that's left. I'm more of a do all the research first sort of person, but there are plenty of different approaches, so I'd just focus on the total amount of time you have.
Some people find that having an advance expression of interest, or even a contract, can help them relax enough to write; if that's the kind of writer you are, then prioritizing the proposal and a polished sample chapter early in the process - say, by the end of a year or 18 months - can be very helpful. Other people find contracts paralyzing when, as inevitably happens, the process takes longer than they confidently told a press it would. And some people spend too much time writing the perfect proposal, and don't get around to the book until it's getting quite late. Again, it's all about figuring out what works best for your writing process.
You also need to think about whether your institution will expect other things from you as well. Mine needs articles in addition to the book - that's where Hegemony's research-write-research-write approach can be helpful, because you can publish early versions of the chapters as articles. Some places sometimes look askance at too much of that (some presses do, too) - so again, it's important to get good early advice about your own institutional norms, as well as to have a sense of where the discipline is going.