Knowing why you want to write a book is a critical step. It's not the same for everyone.
Do you want to make money?
Is it to establish yourself as an expert in the field?
Is it for personal satisfaction?
Did you see an education gap you'd like to fill?
What's your why?