It is reported that ʿAlī b. ʾAbī Ṭālib – Allāh be pleased with him – said:

Do not be with the sinner (fājir), for he will beautify to you the things he does, and he will want you to be like him; and he will beautify to you the worst of his practices; and his entrance upon you and leaving from your company will cause ignominy and discredit [of you].

And do not accompany the fool (aḥmaq), for he will exhaust himself [to help you] but will not benefit you, and he may want to benefit you but end up harming you; his silence is better than his speaking, his distance is better than his closeness, and him dying is better than him living.

And do not accompany the liar, for life will not benefit you with him, he will tell others what you say, and tell you what others say; and if you speak the truth, it will not be believed.

Abū Bakr Al-Daynūrī, Al-Mujālasah wa Jawāhir AlʿIlm no. 1379.