The Book of the Prohibited actions

Riyad as-Salihin · Chapter 267

Prohibition of Abusing the Deceased without a valid Legal reason approved by Shari'ah

باب تحريم سب الأموات بغير حق ومصلحة شرعية

A single hadith carries this chapter, and its lesson is quiet but firm: the dead are beyond our reach and have already moved on to what their deeds earned them. Speaking ill of them serves no purpose and only wounds the living who loved them.

Notice the wisdom of letting the deceased rest. Their account is now with Allah, settled by what they sent ahead, so our words can neither help nor harm them, only burden our own tongues.

Hadith 1564

'Aishah (May Allah be pleased with her) said:

وعن عائشة رضي الله عنها قالت‏:‏ قال رسول الله صلى الله عليه وسلم ‏:‏ ‏ "‏لا تسبوا الأموات فإنهم قد أفضوا إلى ما قدموا‏" ‏‏.‏ ‏(‏‏(‏رواه البخاري‏)‏‏)‏‏.‏

The Messenger of Allah (ﷺ) said, "Do not abuse the dead, because they have attained that which they had forwarded (i.e., their deeds, good or bad)." [Al-Bukhari].

In plain words

Do not speak ill of those who have died, for their account is now settled by the deeds they sent ahead. Such words help no one and only burden the speaker.

Reference : Riyad as-Salihin 1564 In-book reference : Book 17, Hadith 54