The friendship part is probably the hardest. But what's the success rate of shaming someone into changing their mind? Pretty low to zero. It makes them dig in more.
The best example I know of is Daryl Davis (https://en.m.wikipedia.org/wiki/Daryl_Davis). He's a black man that befriends active Klan members. He invites them to bars and his home and gets to know them.
He intelligently refutes their nonsense but he never asks them to change their mind or leave the Klan. He simply waits until they want to do it on their own accord.
The problem is sometimes people get stuck in a group or culture for various reasons. The key is to give them a safe, friendly alternative rather than a violent disagreement.