There is no one right way to write a book. There is the way that works for you. There is even the way that works for a particular book, which may be different than the way it worked for a previous book you wrote.
It's about finding out what works and following that thread for as long as it works. Maybe it's scribbling ideas on index cards. Maybe it's creating mind maps. Maybe it's recording voice memos when the ideas strike. Maybe it's using an app like Evernote or Scrivener.
The important thing is getting the words out. That's the main thing in the writing phase. So do what works. Trust the process that emerges for you.