proverb

Better be alone than in bad company.

friendship

states that

If the people you stay with are the wrong type, remaining alone is much better for you.