Sahih al-Bukhari, Book 52, Hadith 26 (In-Book)

Narrated Abu Bakra: A man praised another man in front of the Prophet. The Prophet said to him, "Woe to you, you have cut off your companion's neck, you have cut off your companion's neck," repeating it several times and then added, "Whoever amongst you has to praise his brother should say, 'I think that he is so and so, and Allah knows exactly the truth, and I do not confirm anybody's good conduct before Allah, but I think him so and so,' if he really knows what he says about him."

حَدَّثَنَا مُحَمَّدُ بْنُ سَلَامٍ أَخْبَرَنَا عَبْدُ الْوَهَّابِ حَدَّثَنَا خَالِدٌ الْحَذَّاءُ عَنْ عَبْدِ الرَّحْمَنِ بْنِ أَبِي بَكْرَةَ عَنْ أَبِيهِ قَالَ أَثْنَى رَجُلٌ عَلَى رَجُلٍ عِنْدَ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَقَالَ وَيْلَكَ قَطَعْتَ عُنُقَ صَاحِبِكَ قَطَعْتَ عُنُقَ صَاحِبِكَ مِرَارًا ثُمَّ قَالَ مَنْ كَانَ مِنْكُمْ مَادِحًا أَخَاهُ لَا مَحَالَةَ فَلْيَقُلْ أَحْسِبُ فُلَانًا وَاللَّهُ حَسِيبُهُ وَلَا أُزَكِّي عَلَى اللَّهِ أَحَدًا أَحْسِبُهُ كَذَا وَكَذَا إِنْ كَانَ يَعْلَمُ ذَلِكَ مِنْهُ

sunnah.com