The Similitude of Good Company and that of Bad Company
Abu Musa Al-Ashari (radi Allahu anhu) reported: I heard the Prophet (sal Allahu alaihi wa sallam) saying, “The similitude of good company and that of bad company is that of the owner of musk and of the one blowing the bellows. The owner of musk would either offer you some free of charge, or you would buy it from him, or you smell its pleasant fragrance; and as for the one who blows the bellows (i.e., the blacksmith), he either burns your clothes or you smell a repugnant smell.”
[Sahih al-Bukhari and Muslim]
This Hadith enjoins that one should sit in the company of the pious persons and avoid the impious ones because the former has the quality of a perfume seller and the latter of a blacksmith. In the association of pious men, one stands to gain all the time and ultimately becomes like them. In bad company one is out-and-out a loser and can never hope to gain any benefit from them.
And Allah Knows Best!