Anas bin Malik reported,

The Prophet ﷺ visited a man from Banu Najjar who was ill, and said to him, "Uncle, say, 'There is no god but Allah.'"The man asked, "Am I your maternal uncle or your paternal uncle?"The Prophet ﷺ replied, "Maternal uncle."Then he said to him, "Say, 'There is no god but He.'"The man asked, "Is it good for me?"The Prophet ﷺ answered, "Yes."

Azami 3498

Sahih

عن أنس

أن النبي ﷺ دخل على رجل من بني النجار يعوده، فقال له رسول الله ﷺ: يا خال قل: لا إله إلا الله فقال: أو خال أنا، أو عم؟ فقال النبي ﷺ: لا، بل خال فقال له: قل لا إله إلا هو قال: خير لي؟ قال: نعم.

الأعظمي 3498صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Dying person
Section
Whoever's last words are "There is no god but Allah" will enter Paradise
Numbering
Jami al-Kamil 3498 (2nd edition)
Azami 3498