In the Bible, there is advice about choosing friends who are wise and hanging out with the righteous.
Before you help someone, you should find out why that person is in trouble. We cannot help people who do not want to change, but they can drag us down. If you have a friend whose friendship you would not recommend to another person you care about, why are you friends with them? Of course we must not abandon someone who is truly in need simply to avoid the hassle, but we also must not let others drag us down in our vain attempt to rescue them. Besides, when we buy a loser’s sad story about their life we rob them of moral agency – they need to realize they are responsible for where they have ended up.
Don’t think that it is easier to surround yourself with good healthy people than with bad unhealthy people. It’s not. A good healthy person is an ideal. It requires strength and daring to stand up near such a person. Have some humility. Have some courage. Use your judgement, and protect yourself from too-uncritical compassion and pity.