Hadith 1577
Wathilah bin Al-Asqa' (May Allah be pleased with him) said:
وعن واثلة بن الأسقع رضي الله عنه قال: قال رسول الله صلى الله عليه وسلم : " لا تظهر الشماتة لأخيك، فيرحمه الله ويبتليك". ((رواه الترمذي وقال: حديث حسن)) وفي الباب حديث أبي هريرة السابق في باب التجسس: " كل المسلم على المسلم حرام" الحديث.
The Messenger of Allah (ﷺ) said, "Do not express pleasure at the misfortune of a (Muslim) brother lest Allah should bestow mercy upon him and make you suffer from a misfortune." [At- Tirmidhi].
In plain words
Do not delight in a fellow Muslim's misfortune, or Allah may show mercy to that person and let the trouble fall on you instead. Compassion, not gloating, is the safer response.
Reference : Riyad as-Salihin 1577 In-book reference : Book 17, Hadith 67