when it comes to slurs in general, i think its important for the writer to take a step back and consider carefully and in full the history of the word, and its effect on people today. with the n word, i think its especially important to take some time to fully consider the weight of the word, because its probably the most normalised of any slur in the english language, despite being the bloodiest. this talk by black british activist Akala really puts that into context well, although its specifically about the black community's use of the n word (which akala used to use a lot, but later swore off the word and encouraged other black people he worked with to do the same). i have no say whatsoever in that particular discussion - though it may be relevant to writing black characters - but his thoughts on the word are still important to consider
ive been in situations in writing before where ive considered using slurs that apply to people in my community - particularly f*ggot, in a context of internalised homophobic and homophobic violence. i decided not to - to censor the word, or more likely replace it with a less hard-hitting insult, because i know what those slurs feel like. even reading it - particularly when immersed in fiction - when a slur comes out like that, you flinch. its not a good feeling. ive been in a majority-black class while reading classics with the n word in it, and when its read out without warning, the discomfort is tangible. especially when the reader is white.
its also just not comfortable to write. you can argue as much as you like about the importance of naturalism and authenticity, but ultimately everything you write is still coming back to you, and the race of the author changes the impact of that word being written out. if the word really is so fundamental to the speech of a black character, then if you replace it with a euphemism, everyone will get the gist. people do this all the time with words like 'brother.'
personally, i believe that there is a very thin line between words you write, and words coming out your mouth, in terms of their impact. to use the n-word as a nonblack person requires a very, very good reason, and i'm not sure those reasons exist.