It is reported that Al-Fuḍayl b. ʿAyyāḍ – Allāh have mercy on him – said:
Do not mix except with those who have good character; for the one who has good character brings nothing but good, whilst the one who has bad character brings nothing but evil.
Al-Bayhaqī, Shuʿab Al-Īmān, #87044