When the Messenger of Allah ﷺ stood to perform the funeral prayer over a deceased person, he would say, "O Allah, Your servant and the son of Your maidservant is in need of Your mercy, and You have no need to punish him. If he was a doer of good, increase his good deeds, and if he was a wrongdoer, overlook his sins."
كان رسول الله ﷺ إذا قام للجنازة ليصلي عليها قال: اللهم عبدك وابن أمتك احتاج إلى رحمتك، وأنت غني عن عذابه، إن كان محسنا فزد في إحسانه، وإن كان مسيئا فتجاوز عنه.
Hakim narrated it (1/359) from Abu Muhammad Abdul-Aziz bin Abdul-Rahman Khallal in Makkah, who said, Abdul-Rahman bin Ishaq the scribe told us, Ibrahim bin Munzir Hizami told us, Husayn bin Zayd bin Ali bin Husayn bin Ali told us, from Jafar bin Muhammad, from his father, from Yazid bin Rukanah, and he related it.Hakim said, "This isnad is sahih, and Yazid bin Rukanah and his father Rukanah bin Abd Yazid are two companions from Banu Muttalib bin Abd Manaf, though the two of them (Bukhari and Muslim) did not narrate it."I say, its isnad is hasan because of Ibrahim bin Munzir Hizami, for he is hasan al-hadith. The discussion of him is given at length in the Book of Funerals.