Supplication During the Funeral Prayer

After the third [takbīr of the Funeral Prayer], one supplicates for the deceased saying:

O Allāh, this is Your servant, son of two of Your servants. He has
left the comfort of this world and its abundance and the things he
loved and the people who loved him, on to the darkness of the grave
and what waits ahead. He testified that there is no deity except
You—You only, without partner—and that Muḥammad is Your slave and
messenger. And You are more knowledgeable of him than we are.

O Allāh, verily he has gone to remain with You and You are the best
with whom one could remain. He has become in need of Your mercy, while
You have no need to torture him. We have come to You, seeking for him
Your intercession.

O Allāh, if he was good then increase him in his goodness; if he was
wicked then forgive him and meet him with Your mercy and Your
satisfaction [with him]. Protect him from the trial of the grave and
its torture. Make his grave spacious for him, and spread the ground
away from his flanks. And through Your mercy, meet him with amnesty
from Your torture until You resurrect him to his paradise in safety,
by Your mercy, O most merciful of the merciful!1

The supplications of the Prophet ﷺ are beautiful.