Riyad as-Saliheen 950
Anas (May Allah be pleased with him) reported:
Some Companions happened to pass by a funeral procession (bier) and they praised him (the deceased). The Prophet ﷺ said, "He will certainly enter it." Then they passed by another funeral procession and they spoke ill of the deceased. The Prophet ﷺ said, "He will certainly enter it." `Umar bin Al-Khattab (May Allah be pleased with him) said: "(O Messenger of Allah,) what do you mean by `He will certainly enter it?'' He ﷺ replied, "You praised the first person, so he will enter Jannah; and you spoke ill of the second person, so he will enter Hell. You are Allah's witnesses on earth."
[Al-Bukhari and Muslim].
عن أنس رضي الله عنه قال: مروا بجنازة، فأثنوا عليها خيراً، فقال النبي ﷺ الله عليه وسلمى الله عليه وسلم الله عليه وسلم : "وجبت”، ثم مروا بأخرى، فأثنوا عليها شراً، فقال النبي ﷺى الله عليه وسلم الله عليه وسلم الله عليه وسلم : "وجبت" فقال عمر بن الخطاب رضي الله عنه: ما وجبت؟ قال: "هذا أثنيتم عليه خيراً، فوجبت له الجنة، وهذا أثنيتم عليه شراً فوجبت عليه النار، أنتم شهداء الله في الأرض” ((متفق عليه)).