The Prophet ﷺ said, "The best way to seek forgiveness is to say, 'O Allah, You are my Lord, there is no god but You. You created me and I am Your servant, and I hold to Your covenant and Your promise as best I can. I seek refuge in You from the evil of what I have done. I acknowledge Your favor upon me, and I acknowledge my sin, so forgive me, for none forgives sins except You.'"He said, "Whoever says these words during the day with firm conviction in them and dies that day before evening, he is among the people of Paradise. And whoever says them during the night with firm conviction in them and dies before morning, he is among the people of Paradise."
عن النبي ﷺ: سيد الاستغفار أن تقول: اللهم أنت ربي، لا إله إلا أنت خلقتني وأنا عبدك، وأنا على عهدك ووعدك ما استطعت، أعوذ بك من شر ما صنعت، أبوء لك بنعمتك علي، وأبوء لك بذنبي فاغفر لي فإنه لا يغفر الذنوب إلا أنت. قال: ومن قالها من النهار موقنا بها فمات من يومه قبل أن يمسي فهو من أهل الجنة، ومن قالها من الليل وهو موقن بها فمات قبل أن يصبح فهو من أهل الجنة.
Bukhari narrated it in the Book of Supplications (6306), from Abu Muamar, who said, Abdul-Warith narrated to us, Husayn (he is al-Muallim) narrated to us, Abdullah bin Burayda narrated to us, from Bashir bin Kaab al-Adawi, who said, Shaddad bin Aws narrated to me, and he related it.