Islam treats companionship as a form of religion, because a person is shaped by whom he sits with. The Prophet (ṣallallāhu ʿalayhi wa sallam) compared the righteous companion to a seller of musk — you either gain from him or at least smell something pleasant — and the bad companion to a blacksmith's bellows, which burns you or leaves you with a foul smell. He also said, "A man is upon the religion of his close friend, so let one of you look carefully at whom he befriends." This does not mean cutting off non-Muslim colleagues, relatives, or neighbours, whom Islam commands us to treat justly and kindly; it means that one's inner circle — those who influence your worship, speech, and priorities — should be people of taqwā, since the Qurʾān warns of the regret of the one who took a corrupting friend and states that on the Day of Judgement close friends will be enemies to one another, "except the righteous."
Q&A · General
How should a Muslim choose friends and close companions?
Evidence — the daleel
On deen2u
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.