Anas bin Malik reported,

A funeral procession passed by, and the people praised the deceased. The Prophet ﷺ said, "It is confirmed."Then another funeral procession passed by, and the people spoke ill of the deceased. The Prophet ﷺ said, "It is confirmed."Umar said, "May my father and mother be ransomed for you. A funeral passed by and the people praised the deceased, and you said, 'It is confirmed.' Then another funeral passed by and the people spoke ill of the deceased, and you said, 'It is confirmed.'"The Prophet ﷺ replied, "Whoever you praised, Paradise has been confirmed for him, and whoever you spoke ill of, the Fire has been confirmed for him. You are Allah's witnesses on earth."

Nasai 1934

Sahih

أخبرني زياد بن أيوب قال حدثنا إسمعيل قال حدثنا عبد العزيز

عن أنس قال

مر بجنازة فأثني عليها خيرا فقال النبي ﷺ وجبت ومر بجنازة أخرى فأثني عليها شرا فقال النبي ﷺ وجبت فقال عمر فداك أبي وأمي مر بجنازة فأثني عليها خيرا فقلت وجبت ومر بجنازة فأثني عليها شرا فقلت وجبت فقال من أثنيتم عليه خيرا وجبت له الجنة ومن أثنيتم عليه شرا وجبت له النار أنتم شهداء الله في الأرض

النسائي 1934صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Funerals
Chapter
Praise
Numbering
Darussalam 1934
Nasai 1934