Riyad as-Salihin 920
The Book of Visiting the Sick
Good Words to be Uttered before a dying Person and his Family
Umm Salamah (May Allah be pleased with her): The Messenger of Allah (ﷺ) said, "When you visit a sick or a dying person, you should utter good words because the angels say `Amin' at what you say.'' She added: When Abu Salamah (May Allah be pleased with him) died, I came to the Prophet (ﷺ) and said: "O Messenger of Allah, Abu Salamah has died." He (ﷺ) directed me to supplicate thus: "Allahummaghfir li wa lahu, wa a`qibni minhu `uqba hasanatan [O Allah, forgive me and him, and bestow upon me a better future (give me a better substitute)]." So I supplicated as he directed, and Allah gave me a man who was better for me than Abu Salamah (i.e., the Prophet (ﷺ) Muhammad (ﷺ)). (The Prophet (ﷺ) married Umm Salamah afterwards.) [Muslim].