Bismihi ta'ala
In Islam, severing ties with family and kin is haram and considered a major sin. As for a friend, there are many necessary requirements and conditions for a believer to take someone else as a friend.
Friendship and Islamic brotherhood is extremely important, and we have many narrations that give us the guidelines of how selective we need to be with those who we associate with. We should be social, but never at the cost of exposing oneself to a morally polluted environment.
As humans, we are easily influenced by our surroundings, as strong as we may be, and therefore we must always be cautious about who we mix with. Someone who is careless about what they say and uses foul language, or backbites, or lies, is certainly not the kind of person you should consider as a friend or associate with.
Islamically, it is haram to be in the same gathering with someone who backbites, and you should stay away from such people. Of course, at first you should try to give advice and encourage them to be observant of what they say, but if that fails, then distance yourself.
And Allah knows best.