I witnessed the Messenger of Allah ﷺ perform the funeral prayer over a man from the Ansar, and I heard him say, "O Allah, send blessings upon him, forgive him, have mercy on him, grant him well-being, pardon him, wash him with water, snow, and hail, cleanse him from sins and faults as a white garment is cleansed from dirt, give him in exchange a home better than his home, a family better than his family, and protect him from the trial of the grave and the punishment of the Fire."Awf said, "Standing there at that moment, I found myself wishing I were the one in that man's place."
حدثنا يحيى بن حكيم حدثنا أبو داود الطيالسي حدثنا فرج بن الفضالة حدثني عصمة بن راشد عن حبيب بن عبيد
شهدت رسول الله ﷺ صلى على رجل من الأنصار فسمعته يقول اللهم صل عليه واغفر له وارحمه وعافه واعف عنه واغسله بماء وثلج وبرد ونقه من الذنوب والخطايا كما ينقى الثوب الأبيض من الدنس وأبدله بداره دارا خيرا من داره وأهلا خيرا من أهله وقه فتنة القبر وعذاب النار قال عوف فلقد رأيتني في مقامي ذلك أتمنى أن أكون مكان الرجل
[Sahih] Tabarani narrated it, 18/59, no. 108, through another route from Ismah bin Rashid and others, with this wording. Muslim narrated it, no. 963, from the hadith of Habib bin Ubayd, from Jubayr bin Nufayr, from Awf, with similar wording, and this is the preserved version.