The only way to write a book is to sit down and write. It may seem self-evident, but the first draft of a book, from which comes everything else, can only be achieved by sitting down, writing and forgetting about any consequences. Other steps in writing a book include conceptualizing, outlining and editing.
To conceptualize the novel, the snowflake method can help. Write down simple facts, plot ideas and other information, sticking to a single sentence. Then build from each bit of information until the subject is fully fleshed out.
To keep on track, set a certain time during which to write or set a certain word count to meet. It also helps to outline the book beforehand. Outlining makes it clear what to write and how the book should end.
After finishing the first draft, leave the draft alone before going back to make edits. Pouring a great deal of work into a book, fiction or nonfiction, can be emotional, and it's easy to recoil from any negative judgement. Look at the first draft from the point of view of a reader. Then make necessary edits, ideally making more than one editing run. Do one edit for content, one for clarity, and one for copyediting. Doing the copyediting draft last keeps the writer from having to clean up the work while writing.