ذِكْرُ مَا يُسْتَحَبُّ لِلْمَرْءِ إِذَا صَلَّى عَلَى جَنَازَةٍ أَنْ يَسْأَلَ اللَّهَ الزِّيَادَةَ لِلْمُصَلَّى عَلَيْهِ فِي حَسَنَاتِهِ، وَالْمَغْفِرَةَ لِسَيِّئَاتِهِ
from the Prophet ﷺ when he prayed during a funeral he would say, “allāhuma ʿabduk, wa-ibnu ʿabdik, kāna yashhadu an lā ilaha illā allāh wa-anna muḥammadun ʿabduka wa-rasūluk, wa-anta aʿlamu bihī minnī, in kāna muḥsinun fa-zid fī iḥsānihi, wa-in kāna musīʾun fa-ighfir lah, wa-lā taḥrimnā ajrah, wa-lā taftinnā baʿdah (O Allah, Your slave and the child of Your female slave is in need of Your mercy, and You are not in need of his torment. If he was pious then increase his rewards and if he was a transgressor then pardon him.)
عَنِ النَّبِيِّ ﷺ أَنَّهُ كَانَ إِذَا صَلَّى عَلَى جَنَازَةٍ يَقُولُ «اللَّهُمَّ عَبْدُكَ وَابْنُ عَبْدِكَ كَانَ يَشْهَدُ أَنْ لَا إِلَهَ إِلَّا اللَّهُ وَأَنَّ مُحَمَّدًا عَبْدُكَ وَرَسُولُكَ وَأَنْتَ أَعْلَمُ بِهِ مِنِّي إِنْ كَانَ مُحْسِنًا فَزِدْ فِي إِحْسَانِهِ وَإِنْ كَانَ مُسِيئًا فَاغْفِرْ لَهُ وَلَا تَحْرِمْنَا أَجْرَهُ وَلَا تَفْتِنَّا بَعْدَهُ»