This is a question that's asked here continually, it probably comes up two or three times a week. It's safe to say that someone who needs to ask strangers on the internet how to write a book step-by-step is not someone who's ready to actually write a book, much less a book that anybody might be interested in publishing. There are many different types of books out there, so asking how one might go about writing one is a pointless question as different books are crafted in different ways. And because there are so many different things that each individual agent or publisher might consider before agreeing to enter into a business arrangement with an author, it wouldn't make any sense to go into that either.
Without knowing specifically what type of book you're asking about, it would be impossible to offer any advice particular to that situation. People who want to write a novel would not follow the same composition process or go through the same steps to publish their manuscript as someone who wishes to write a book about a specific historical period, event, or historical figure. The two authors would also not look to work with the same publishing house either, so the process would be completely different.
This site is not geared toward the discussion of such complex topics. Essentially what you're doing is attempting to ask a slew of questions and to disguise them as one single question. Think about what you want to know, prioritize the most important pieces of information you're after and then post those queries as separate questions. No one is going to walk you through all of this step-by-step, hand-in-hand because that's not why we're here. Post your questions in manageable chunks if you wish to receive a solid, easily comprehensible answer.