I was recently reading about Shadowrun 5e when I saw that one of the drawbacks your character can have is being a racist. This got me thinking about how racism is used in games and how GMs and players can handle it.
Obviously racism in the real world is abhorrent. It's utterly reprehensible and yet the world is still rife with it. When you look at games, usually fantasy and sci fi, you will often find in-built racial tensions as part and parcel of the system or setting. This extends from literature, where books like The Lord of the Rings show hatred between dwarves and elves, one of the more classic dichotomies. Of course races in these instances are essentially different species. In the real world we're all human, no matter where you're from, but in a game human is just one type of sentient creature .
Still, racism can be something that challenges the players. In my own campaign setting, Peakvale, racism is actually one of the driving forces behind the political upheaval occurring in the autocracy. Humans and halflings are the favoured races, with better jobs and prospects whereas everyone else lives in squalor. One race has even been exiled from the country. So it sets up a situation where a group of characters with a mixture of races will lead to some interesting choices and sometimes uncomfortable decisions. The setting doesn't present racism for racism's sake. There is a clear problem in the political system and characters must decide where they stand and how much they risk.
What shouldn't happen at the table is tension between races as some kind of novelty. If it's something you're going to feature in your game then it needs to be there to tell a story and challenge the players. Don't cheapen it. If a player is going too far and making others feel uncomfortable then call them out. Adding racial tension to a game should never ever be an excuse for vulgarity. It should be an opportunity to explore ideas and preconceptions in a safe environment.