Metta or mudita (sympathetic joy) might help but wisdom is of paramount importance.
In short?
• Reflect on the shortness of life
• Reflect on kamma (long term consequences what condemnation will give you)
• Reflect that they too will eventually lose family, friends and material possessions
• Reflect that they are subject to aging sickness and death
Long answer?
There are these five facts that one should reflect on often, whether one is a woman or a man, lay or ordained. Which five?
"'I am subject to aging, have not gone beyond aging.' This is the first fact that one should reflect on often, whether one is a woman or a man, lay or ordained.
"'I am subject to illness, have not gone beyond illness.' ...
"'I am subject to death, have not gone beyond death.' ...
"'I will grow different, separate from all that is dear and appealing to me.' ...
"'I am the owner of my actions,[1] heir to my actions, born of my actions, related through my actions, and have my actions as my arbitrator. Whatever I do, for good or for evil, to that will I fall heir.' ...
"These are the five facts that one should reflect on often, whether one is a woman or a man, lay or ordained.
AN 5.57 https://www.accesstoinsight.org/tipitaka/an/an05/an05.057.than.html