Anas bin Malik reported,

A funeral procession passed by the Prophet ﷺ, and the people praised the deceased with good words. He said, "It has become due."Then another funeral passed by, and they spoke ill of the deceased, or he said something to that effect. He said, "It has become due."Someone asked, "Messenger of Allah, you said for this one 'It has become due,' and for that one 'It has become due.'"He replied, "The testimony of the people. The believers are Allah's witnesses on earth."

Bukhari 2642

Sahih

حدثنا سليمان بن حرب حدثنا حماد بن زيد عن ثابت

عن أنس رضي الله عنه قال

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

البخاري 2642صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Testimonies
Chapter
How many witnesses are sufficient for validation
Numbering
Darussalam 2642
Bukhari 2642