I'm going to probably be a slight jerk about this here, but I'm tackling this subject purely from a "writing standpoint". That is, how best to write characters.
1. Characters are people first. They aren't their gender, ethnicity, or sexual orientation. These things are not personality traits. These are not what make a character anything unless your setting is about those things. If your setting is about those things, you run the risk of "being preachy" or "overly political" and having your story bomb on that basis alone. To a normal human being without mental issues, these three characteristics that make up who they are... are tertiary at best. That is, we rarely think of ourselves as our gender, as our ethnicity, or as our sexual orientation. We think of these subjects about ourselves only when they come up in conversations or situations. People primarily think of themselves as their personality traits first, opinions on subjects second, and how they look third (as in, terms of attractiveness, not their skin color or gender). Anything else is "unimportant" to our self identity. So, you write people as people. Who is this person? What is their personality? What are their opinions? How do they view their own physical characteristics in terms of what they're ashamed of and what they find attractive ("I hate the way my nose looks! My legs are very muscular!")?
2. Gender, Ethnicity, and Sexual Orientation are rather boring subjects to tackle in terms of writing. Why? Because everyone comes in with preconceived notions. You aren't going to make someone view one of these subjects differently. People rarely change their minds or admit they were personally at fault. Anything you think you're saying on the subject of these is probably going to be taken out of context anyway. There is no use in worrying about what color your characters are, what gender they are (unless gender is relevant to their personality to some degree), or what sexual orientation they are. People who view it are going to put their own biases on it anyway and come in either loving it or hating it before ever seeing it and not really changing their mind on it as they finish it. If you have just one thing that could be seen as "problematic", people who went in wanting to hate it will find it, and will use that one thing to declare the entire rest of your writing as terrible. You get no points for doing anything well, only points for doing things "perfectly". That is, not offending anyone. Which is, by the way, impossible.
3. A person being black in a setting doesn't matter unless that skin color is a plot point. That is to say, it doesn't matter what parallels the skin color of a character has to our world. Their experiences as a character are going to be different depending on the world they live in. If they never experienced "racial segregation" in the same terms as was experienced in our real world, they're not even going to have the same opinions on the subject that we would. Many authors often forget that they're writing a fictional world. It has very little, if any, relevance to our own. Your duty is to the story being told and not to the audience you're performing for. If you tell a good story, it will be reflected in the audience you acquire. You cannot do any effective writing if you are worried about upsetting potential critics. The world is not "nice and fuzzy". It is not rainbows and sunshine. The world is often cruel, nonsensical, and unjust. Do not try to remove all possible contentious points of your story just to ensure critics won't hate it. You are writing for the people who want to read your story. You are not writing for the people who want to hate your story.
4. People, by and large, look for reasons to discriminate against each other. If it isn't one thing, it would be another. People like to create enemies to fight against. People who are lower than them so that they can feel good about themselves and their lives. This is something anyone who is writing needs to know. Knowing this allows you to create effective conflict. If skin color doesn't matter in the world you're writing, then there's got to be some other form of discrimination present that society accepts. Rich versus Poor. Religious versus Non-Religious. Status versus No Status. Etcetera. People's basic instincts is to delegate some people above themselves and some people below themselves. They simplify this process by using a generalization. This is the crux of conflict.
---
My personal example of how I've written a couple of "black" characters:
One of them is a pirate. He spends most of his time on the seas. Getting goods from location to location. Not always legally. He's written more as a "Malcom Reynolds" type (If you've ever seen the series Firefly or the movie Serenity, you know what I mean). His crew comes first, his ship and ability to sail coming second. The sea is his mistress and staying out of all politics is his personal philosophy. He's not interested in money, only interested in sailing the sea with his crew. He plays "The Father Figure" to the entire group of heroes and philosophizes a lot. He enjoys one of the oldest religions in the setting and uses it not to preach, but to teach (he applies the scripture to real life situations when offering advice or deciding what to do in tough situations. He does not care to tell others how to live or try to get anyone to share his religion with him).
The second is a thief. His entire personality and philosophy are "Things have no value if they are easy to steal". He chases challenge. What he steals isn't as important to him as how difficult it was to take it. Each thing he has stolen is just a trophy for him. It holds no value to him beyond that. Things that were too easy to steal he sells for money to survive (they hold no value for him, but hold value to others!). He will rarely turn down any challenge and tries not to ever be predictable. The most recent object he is trying to steal is the heart of the "Queen" of the elves. She is the Elves greatest treasure, she has never been in love, but has been approached by thousands of suitors in her lifetime. Stealing her heart would be the ultimate treasure. It is something nobody has ever obtained and likely will never obtain again. What's more? Her thinking on the subject is much the same. If he wants to win her heart, then she's going to make it as challenging as possible to try to sway her. She'll provide the challenge and he will complete the challenge, and maybe, someday, she'll fall in love with him.
So, here we are. At first glance, what I have here is "problematic". Black people portrayed as criminals!? Here's the problem though:
Every single one of the heroes in my setting is a criminal. They've "sinned" to some degree. Trampled others. Done illegal things. Operate in moral grey areas. It is a cast of undesirables. The skin color doesn't actually matter in my setting. It was chosen in service to Lore the player will never (probably) be privy to (they're descendants of one of the early settlers to the land, and since the settlers had originally come from many different nations, one of the ships was naturally captained and crewed by that particular race. The land has since become a "melting pot" and skin color or gender doesn't matter at all as those are FAR LESS important than anything else going on).
I'm writing a story. I'm writing characters. I'm writing for people who might find the setting and characters compelling. I'm not writing to see if someone is going to find what I'm writing as "problematic" or not. After all, the subject matter has nothing to do with issues in the real world. It is its own world. With its own rules and history and problems. It's a world that has its own slurs for people and its own "acceptable targets". What matters in real life doesn't matter in this other world I've crafted from the "Ether of the Endless Void" (how I usually view the process of creating entirely new worlds as a writer. Creating universes from nothing).
The morality of the world I live in doesn't matter at all to the morality of the worlds I've created.