Research slowly. Write steadily.

It can take many months or years to assemble a book. Sometimes there are gaps in your work as an author, as life intervenes.
It’s fine to work on a book from time to time as your availability allows. But once you start writing in earnest, it’s best to keep going.
The fundamental principle is: Research slowly, write steadily.
Research works at whatever pace suits you
In research mode, you’re assembling content that you’ll use in the book. This includes web research, data collection and analysis, and interviews.
It can take a long time to line all that up. And it’s fine to keep collecting research at whatever speed your other work allows. So long as you’re making some progress on the elements that will go into your book, your research work can make a productive contribution.
But don’t take long pauses in your writing
After you’ve settled on your audience and the problem you’ll be solving and have a solid bead on your main idea, you’re in a great position to nail down your table of contents. Then you can start writing, taking advantage of all the research you did leading up to this point.
Drafting a chapter at a time works best if you’ve got the whole concept clear in your mind, so you can see how the chapter you’re working on fits in. If you wait two months between Chapter 2 and Chapter 3, you’ll lose that context. You’ll need to go back and reread what you’ve written (and be tempted to tinker with it), which is inefficient.
So it’s best to start writing on a steady schedule. That could be an hour a day, or four hours every weekend. Some people take time off and draft the whole book steadily in a couple months. So long as your brain is locked in to what you created just before, what you’re working on, and what comes next, you’ll be well positioned to create useful and appropriate prose.
Having drafted the whole book, you can then take a pause if needed. You’ll want to revise your draft, another task that’s far more effective if you do it without gaps in your work schedule.
Keep this in mind as you plan your book work
A steady writing schedule is a time commitment. It’s ineffective to start if you don’t know how you’re going to finish.
So remember: research slowly and write steadily. That will keep your chapters unified and your morale high. That’s how you create a book that reads coherently, too. Productive writers generate prose that hangs together, leading to more satisfied readers.
I try to invoke Newton’s First Law of Motion with my clients. As you point out, unexpected lapses in writing may be unavoidable at times, but they ultimately hurt the project.