Marketing begins BEFORE you start writing. Marketing begins with research.
If you have an idea, research it before putting hours upon hours of work into creating the book. Make sure the market allows for it, make sure someone will actually BUY it if you create it.
The best way to research your idea is to go directly to the audience you are trying to reach and determine if they have a need or want for a book like yours. First, find the audience. They may be in a forum, or Facebook group or they may belong to another author’s tribe. Wherever they are, find them. Second, ask them if they would be interested in a book about _________. If their answer is “yes”, then ask them if there is a certain aspect of ______ that they want to be included in the book. If their answer is again, “yes”, then ask them the final question. “If I wrote a book about ______ and included your suggestions _____ and _________ would you buy the book?” And Lastly, if their answer is again, “yes” then by ALL means WRITE THE BOOK.