Aghar Abu Muslim reported,

I bear witness regarding Abu Saeed and Abu Hurairah that they both testified concerning the Prophet ﷺ that he said, "Whoever says, 'There is no god but Allah, and Allah is the greatest,' his Lord confirms him and says, 'There is no god but Me, and I am the greatest.'When he says, 'There is no god but Allah alone,' Allah says, 'There is no god but Me alone.'When he says, 'There is no god but Allah alone, with no partner,' Allah says, 'There is no god but Me alone, with no partner.'When he says, 'There is no god but Allah, to Him belongs the dominion and to Him belongs all praise,' Allah says, 'There is no god but Me, to Me belongs the dominion and to Me belongs all praise.'When he says, 'There is no god but Allah, and there is no power and no strength except through Allah,' Allah says, 'There is no god but Me, and there is no power and no strength except through Me.'"And he used to say, "Whoever says these words during his illness and then dies, the Fire will not consume him."

Azami 11098

Sahih

عن الأغر أبي مسلم قال

أشهد على أبي سعيد وأبي هريرة أنهما شهدا على النبي ﷺ أنه قال: من قال: لا إله إلا الله والله أكبر صدقه ربه فقال: لا إله إلا أنا وأنا أكبر، وإذا قال: لا إله إلا الله وحده قال: يقول الله: لا إله إلا أنا وحدي، وإذا قال: لا إله إلا الله وحده لا شريك له، قال الله: لا إله إلا أنا وحدي لا شريك لي، وإذا قال: لا إله إلا الله له الملك وله الحمد، قال الله: لا إله إلا أنا لي الملك ولي الحمد، وإذا قال: لا إله إلا الله ولا حول ولا قوة إلا بالله، قال الله: لا إله إلا أنا ولا حول ولا قوة إلا بي، وكان يقول: من قالها في مرضه ثم مات لم تطعمه النار.

الأعظمي 11098صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Supplications, remembrances, and prayer upon the chosen Prophet ﷺ
Chapter
Supplications for illness and funerals, and what relates to them
Section
Supplication which, if the sick person says it during his illness and then dies, the Fire will not touch him
Numbering
Jami al-Kamil 11098 (2nd edition)
Azami 11098