Write what you want to read is a fairly common bit of writing advice. On its face, it seems to make sense. Be excited about what you are writing because you are creating the book you've been looking for in the bookstore.
There is some truth to it, but what if no one really wants to read what you want to read?
Don't worry, the Internet has another piece of advice. Study the market for your genre or topic to see what people are buying before you start writing.
And with that, we have two opposing pieces of advice that often pose as rules and are often promoted simultaneously on the same website of some hard working writer trying to build their platform.
What's the truth, or at least the correct path? I don't know. I've written stories that I would want to read and have not found anyone to publish them. And I've written stories that come from my heart and I find people to publish them.
I've studied the market for ghostwriting clients--a good thing to do in that scenario--but not for my own writing. I have to feel something for what I am writing, which is often an emotional connection or an artistic desire. Sometimes, others get it and like it so they publish it, but not always.
So the rule, if you could call it that, is to write what I want to write and always write from the heart or as an artist seeking to broaden my palette.