Umm Salama bint Abu Umaya reported,

The Messenger of Allah ﷺ said to us, "When you are present with a sick or dying person, say good words, for the angels say amen to whatever you say."She said, when Abu Salama died, I came to the Prophet ﷺ and said, "Messenger of Allah, Abu Salama has died."He said, "Then say, 'O Allah, forgive me and him, and grant me a good successor in his place.'"She said, so I said it, and Allah granted me in his place one who was better than him, the Messenger of Allah ﷺ.Shaqiq is Ibn Salama, Abu Waail al-Asadi.

Tirmidhi 977

Sahih

حدثنا هناد حدثنا أبو معاوية عن الأعمش عن شقيق

عن أم سلمة قالت

قال لنا رسول الله ﷺ إذا حضرتم المريض أو الميت فقولوا خيرا فإن الملائكة يؤمنون على ما تقولون قالت فلما مات أبو سلمة أتيت النبي ﷺ فقلت يا رسول الله إن أبا سلمة مات قال فقولي اللهم اغفر لي وله وأعقبني منه عقبى حسنة قالت فقلت فأعقبني الله منه من هو خير منه رسول الله ﷺ شقيق هو ابن سلمة أبو وائل الأسدي

الترمذي 977صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Funerals
Chapter
Instructing the sick person at the time of death and supplicating for him then
Numbering
Darussalam 977
Tirmidhi 977