I’ve often heard the advice that when writing a book a writer shouldn’t read anything in the same genre. I think the reasoning is that there is the potential to mimic another author. But if you really want to understand your genre, what works and what doesn’t work, then you actually should be reading books within it.
For specific genres, there are specific things that are expected by the reader. And you want to make sure that you aren’t just including them, but that you’re nailing it. Or, if you decide to exclude it, you are doing it in purpose, not from a lack of understanding.
So if you are writing a cozy mystery, read cozy mysteries. If your novel is a YA dystopian, read within the genre. Learning from your favourites isn’t mimicking, it’s, well, learning. And all writers should strive to learn more about their craft, all the time.