The Book of the Prohibited actions

Riyad as-Salihin · Chapter 274

Prohibition of Rejoicing over another's Trouble

باب النهي عن إظهار الشماتة بالمسلم

This short chapter warns against a quiet failing of the heart: taking pleasure when something bad happens to another person. To gloat over someone's trouble is to forget that fortunes change and that we ourselves depend on Allah's mercy.

Notice how the single hadith ties the warning to a consequence. Rejoicing at another's misfortune may cause that mercy to fall on them and the hardship to turn toward us, so the safer path is compassion rather than satisfaction.

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