Abu Ja'far al-Khatmi narrates that his grandfather, Sayyiduna Umayr bin Habib bin Humashah (may Allah be pleased with him), who had reached puberty in the time of the Prophet (peace and blessings be upon him), advised his son and said: "O my son! Beware of sitting with foolish people, for sitting with them is a disease. Whoever is forbearing with a fool remains well, and whoever answers him back regrets it. Whoever is not content with the little that the fool brings will have to be content with much. When any one of you enjoins good or forbids evil, let him prepare himself to be patient with harm and let him hope for the reward from Allah Almighty, for whoever has certainty in the reward from Allah Almighty, the harm that touches him will not hurt him."
Al-Tabarani recorded it in al-Mu'jam al-Awsat, and its narrators are thiqat (trustworthy).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الفتن - أعاذنا الله منها / 12131