Hadithcore
Riyad as-Salihin, 1877

'Aishah (May Allah be pleased with her) reported:

Prior to his demise, the Messenger of Allah (ﷺ) used to supplicate frequently: Subhan Allahi wa bihamdihi; Astaghfirullaha wa atubu ilaihi (Allah is free from imperfection, and I begin with praising Him. I beg forgiveness from Allah and I turn to Him in repentance." <b>[Al-Bukhari and Muslim]</b>.

وعن عائشة رضي الله عنها قالت‏:‏ كان رسول الله صلى الله عليه وسلم يكثر أن يقول قبل موته ‏

‏سبحان الله وبحمده، أستغفر الله، وأتوب إليه‏

‏ ‏(‏‏(‏متفق عليه‏)‏‏)‏‏.‏

References1 variant
In-Book Reference
Book 19, Hadith 9
Sharh · explanationclick to expand
<b>Guidance from the Hadith:</b><br> 1) It shows the manner of the Prophet’s forgiveness-seeking and supplication to Allah Almighty and how he drew closer to his Lord prior to his death.<br> 2) One should not feel secure from the plan of Allah Almighty, for He overturns hearts as He wishes.<br> 3) We are encouraged to observe the comprehensive advice: sticking to glorification of Allah and pursuit of His forgiveness till we die. {Then glorify the praise of your Lord, and ask His forgiveness. Indeed, He is ever Accepting of Repentance.}