Most authors feel compelled to write because they have something to say, or a specific story to tell. Once we get it out, our next priority is to be heard - to have people actually read what we wrote (and worked so hard on!). Unfortunately, we do not always find a wide audience interested in what we have to say. If we do not have success in getting our work out into the world, or realize our topic is more of a niche category, we can get pretty discouraged. It can be tempting to look at genres or topics that are wildly successful and think to ourselves, "I could write that." We might even start trying to adjust our writing style to accommodate what "really sells".
It is a good idea to take a step back from our work regularly to assess what we are choosing to write. It is also important to be realistic with ourselves about the size of the market our particular work targets. It is NOT a good idea to use what is popular or selling as a basis for what we decide to write. Think back to any teacher you've had that was super boring and compare them to a teacher you've had that was interesting and made you enjoy their lecture topic. Odds are, the one who was interesting was personally interested in the topic they lectured about. It is hard to be interesting if you are not interested or at least somewhat invested in what you are writing about. You can write book after book in the top-selling genre, but you may be wasting your time AND be writing about something you don't necessarily like, because you may not be writing a successful piece.
All authors want their works to sell - that's why we bother with publishing in the first place. But we can't allow ourselves to be distracted by other top-selling categories. It is good to diversify our projects, or write in multiple genres, but only do so if those are areas of interest for you as the author. Making money from writing is great, but it is unlikely writing something solely because it is a popular topic or genre is going to produce quality work that will make the money that made you choose that topic in the first place.