Obadiah 12 ESV

“But do not gloat over the day of your brother
in the day of his misfortune;
do not rejoice over the people of Judah
in the day of their ruin;
do not boast
in the day of distress.”

Here God tells the Edomites (the descendants of Esau) not to gloat over the misfortunes of Judah (descendants of Jacob).  When we see the misfortunes of others, whether deserved or undeserved, our reaction according to the sinful nature may be to gloat, or smile with pride, as if we ourselves deserve better.  But if all people as created in God’s image, and we ourselves are saved by grace in Christ, prevent our hearts from taking evil pleasure in their demise.  Even if someone else’s problems are the result of their sinful choices and/or God’s justice, we are not called to rub salt in the wound, so to speak.  Jesus told his disciples to rejoice not because the demons obey them,  but rather that their names are written in heaven and they have the joy of salvation.