The Messenger of Allah ﷺ said, "When you are present with the sick or the dying, speak words of goodness, for the angels say amen to whatever you say."
Azami 536
Sahih
عن أم سلمة قالت
قال رسول الله ﷺ: إذا حضرتم المريض أو الميت فقولوا خيرا، فإن الملائكة يؤمنون على ما تقولون.
Muslim narrated it in the Book of Funerals (919) through various routes from Abu Muawiya, from Amash, from Shaqiq, from Umm Salama, and he mentioned it.