What is one supposed to do when the people around them are making fun of someone else? Especially in the case when you cannot ruin your relationship with the said person who is making fun of others and show disrespect to them? Is being quiet in this situation enough?

One of our responsibilities is Amr bil Ma'roof and Nahi az Munkar. In the event you saying anything will not have any effect of the opposite person will not listen, then try and leave the gathering and if that's not possible either, you can stay.