A fellow game master asked me for advice on how to deal with a potential problem player. They weren’t trying to derail their campaign or anything like that, but they were overly focused on their own goals, would not interact with npcs beyond demanding and receiving their rewards and payment and generally had a very transactional approach to their whole game.
“Oh, so you’ve got an evil player?”

My friend rushed to defend their player at this accusation. They weren’t actively evil, they would go with the party on their plans and participating in the campaign. I agreed that this meant that they weren’t being bad players, but that didn’t mean that they weren’t acting evilly.
Rather than using the infamous Dungeons and Dragons alignment terms of Good and Evil, it would be simpler to treat the extremes as “Communal” and “Selfish”. A typically “Good” character acts in the interest of all, they want to defeat the evil hanging over the area in order to free the villagers, and make life better for all.
An “Evil” or “Selfish” character may still accomplish this task, but their motivations would be different. They may just be in it for the rewards, or to become famous, or want revenge for what happened in their backstory. They may be just as committed to the cause as the rest of the party, but their end-game is different.
So how to treat a player like that? By treating them as evil in the npcs eyes rather than as the hero. Consider a character like Karl Urban’s Judge Dredd, The Boys’ Black Noir or The Punisher. These characters would be seen as doing good work, but I imagine most people would be reluctant to interact with them directly, and would be more likely to interact with their more communal comrades. So treat such players in the same way: the villagers are skittish around them and make excuses to leave inoffensively, visibly relax around the other party members or suggest that they speak to them instead. This isn’t an attempt to punish the player, but rather to have a living world react to their actions and demeanor.
Hope this helps!