If you feel like you gotta censor it, then censor it. You can use symbols, you can blur it out, pixelate it, block it, whatever you need. I kinda wanna say to have the some part of the background block the word from being seen tbh like if they're in a forest, you can obscure it with a branch or something.. You can also have the character interrupt them in the middle of saying the word, like "Don't finish that word" or "You're seriously gonna go there?"
The important thing is that since the whole aspect of the word being a slur is important, you'll need to provide context clues from the person affected by it to show that it's slur. Something that'll help us acknowledge that it was a slur, but not something that so blatantly telling the readers so either. Have the character reflect on it like "You're not allowed to use that word" or "I've been called this a bunch, but I didn't think it'd come from you" or "You act like this was a choice I made" something that shows how hurt the other character is by the usage of the specific word.. but idk, these are just some ideas I'd go wirh