Some works by Stephen King provide a good, modern example of how to do this. The Green Mile is one example. Don’t sugar-coat evil, that just makes bad people look better than they actually are. Tell the truth about what your characters would say. If you don’t want to write those words in your book, that’s okay too. I wouldn’t water it down though, I’d just not quote the character directly when they use the slur, and show through context that people around them are shocked and disgusted, which would give the reader a good idea of what the character said and how foul it was.
Malorie Blackman got around this problem by making up racist slurs in the Noughts and Crosses series and using context to show the effects these words had, which hinted at their real-life equivalents. I think it was a bit different though because the books were aimed at teenagers and set in an alternate world so she could create her own 'realism'. Like most others have said, a lot of it will come down to whether it looks like you're condoning using this language or whether it is clearly the beliefs of a character who the audience is not supposed to be sympathetic to.
I keep writing novels where the MC is a racist, and I completely forgot he was when I responded to this thread. Ain't dat a kick in da head? https://www.writingforums.org/threads/waldo-the-incubus-2139-words.149996/#post-1520619 a dead evil racist story.
This thread topic is a reflection of modern society. The PC police are out there. Big Brother and Big Sister ready to pounce.
Oh, please. You--that is, people who talk about Big Brother being behind, aiee! The horror of trying to avoid racism!--are the ones waiting to pounce on anyone who dares to commit the crime of wishing for clarity in their communication.
You might want to read the short stories of Flannary O'conner. Good author, But she doesn't spare the language or the situations. She's respected.
The main character in my novel series is a racists. In fact the whole idea of political correctness is right out with him. In the first few paragraphs of the first novel I fixed the problem so that I would never have to deal with it again. It was the cowards way out but I have never been known for my bravery. So... let's write some racist stories and see if the sky actually does fall. I'm not even sure what racism is as a solid definition. I'd sure like to read some other views on the topic that doesn't involve altered bed sheets or shouting.
This. Hell, in my book, the second paragraph talks about the "no-good Micks," which is a racist term. But it fits the character.