"I heard the Messenger of Allah say: 'When you see the dead, say something good, for the angels say Amin to whatever you say; When Abu Salamah died, I said: 'O Messenger of Allah, what should I say?' He said: 'Say" Allahummaghfirlanaa wa lahu wa a 'qibni minhu 'uqbai hasanah (O Allah, forgive us and him, and compensate me well for this loss.)"' Then Allah, the Mighty and Sublime, compensated me with Muhammad." (Using translation from Nasāʾī 1825)
سَمِعْتُ رَسُولَ اللهِ ﷺ يَقُولُ إِذَا حَضَرْتُمُ الْمَرِيضَ أَوِ الْمَيِّتَ فَقُولُوا خَيْرًا فَإِنَّ الْمَلَائِكَةَ تُؤَمِّنُ عَلَى مَا تَقُولُونَ قَالَتْ فَلَمَّا مَاتَ أَبُو سَلَمَةَ قُلْتُ يَا رَسُولَ اللهِ كَيْفَ أَقُولُ؟ قَالَ قُولِي اللهُمَّ اغْفِرْ لَنَا وَلَهُ وَأَعْقِبْنِي مِنْهُ عُقْبَى حَسَنَةً وَقَالَ ابْنُ نُمَيْرٍ صَالِحَةً قَالَتْ فَأَعْقَبَنِي اللهُ ﷻ مِنْهُ مُحَمَّدًا ﷺ