How do I differentiate between a deeply flawed character and a deeply flawed writer?

So, little backstory time. I'm a teenager currently living in a conservative household, and truth be told, being in a place like this alters your brain chemistry so much without you realising it. I don't think I'm too bad of a person, at least I try not to be, but I've been... desensitized to themes of misogyny, sexism, racism. These things are so prevalent where I live that it's the norm.

The reason I mentioned this at all is because I've been having issues reading books, something I started recently. I can't seem to understand when a 𝘀𝘩𝘒𝘳𝘒𝘀𝘡𝘦𝘳 is supposed to be a horrible person, and when the 𝘸𝘳π˜ͺ𝘡𝘦𝘳's views are horrible. Or both. (One example is Harlan Ellison's I Have No Mouth & I Must Scream). Perhaps it's common sense to others, but for me it's something I have to learn.

My question is, how do I know when a character is written to be unlikeable, and when the author themself is problematic? How do YOU know it? Are there any books you can recommend that can help me differentiate between the two?

Thank you!

EDIT: I've received a lot of valuable advice from this, and honestly I do not know what to add further than a mere thank you to what everyone has said. I've realised that maybe I was a little too paranoid. Reading and enjoying something written by a questionable person doesn't mean I'm one too. I've also realised that my question can't be answered so simply, since it doesn't have a definite answer. The best approach that I think now is reading more, and forming my own opinions about what the text signifies. Often it may not perfectly align with what the author intended, but that's alright, literature is up to interpretation, that's why it's so amazing. So for the very last time: Thanks a lot, everyone!