An-Nawawi (may Allah shower blessings on him) reported these hadeeths under the Chapter of Seeking Forgiveness.
One of them is the hadeeth of Shaddad bin Aus (may Allah be pleased with him) that the Prophet ﷺ said: "The best supplication for seeking forgiveness (Syed-ul-Istighfaar) is to say: "Allahumma Anta Rabbi, la ilhaha illa Anta, khalaqtani wa ana 'abduka, wa ana 'ala 'ahdika wa wa'dika mastata'tu, a'udhu bika min sharri ma sa'natu, abu'u bidhanbi faghfir li, fa innahu la yaghfirudhu-dhunuba illa Anta. (O Allah, you are my Lord. There is no god besides You. You created me and I am Your slave, following Your covenant and Your promise as much as I can. I seek refuge in You from the evil I have done. I acknowledge before You Your blessings bestowed on me and I confess to You my sins. So forgive me, for surely, no one can forgive sins except You)." "
Whoever supplicates with these expressions during the day with firm belief in the supplication and dies on the same day (before the evening) will be among the dwellers of Paradise. Similarly, the one who supplicates with these expressions in the evening with firm belief in it and dies before the morning will be among the dwellers of Paradise.
The Prophet ﷺ said the best supplication for seeking forgiveness is to say: 'O Allah, You are my Lord; there is none worthy of worship
except You. You created me and I am your servant.’ You acknowledge to Allah with your tongue and heart that He is your Lord, your King, the Controller of your affairs and the Knower of your situation. You are His servant in His Universal and Legislative acts.
As for your servitude to His Universal acts, He does whatever He wishes with you. If He wills, He causes you to fall sick or grants you good health. If He wills, He grants you wealth or makes you poor. If He wills, He guides you or leads you astray based on His Wisdom.
Similarly, you are the servant of His by Legislative acts. You have to worship Him the way He has commanded you. You should carry out His obligations and stay away from His prohibitions. Confess to Him that: “O Allah, You are my Lord. There is no god beside You. You created me and I am Your slave, following Your covenant and Your promise as much as I can.’ You should acknowledge that Allah is the One who created you when He brought you out of nothing. You should follow His covenant and promise to the best of your ability. This is because everyone took covenant from Allah to do what he has been taught:
“When Allah took covenant from those who were given the scriptures to make it known and clear to mankind and not to hide it.” (3:187)
Whenever Allah blesses you with knowledge, it is indeed a covenant you have taken from Him that you will apply it.
“I follow your promise” means I believe in your promise. That is, the good you have promised the good-doers and the evil you have promised the evildoers. But I follow Your promise, that is in goodness. Indeed, you are seeking nearness to Allah – the Mighty and Sublime – with these words.
“I seek refuge in you from the evil I have done.” That is, you are seeking refuge with Allah from the evil you have committed because a person is rewarded for his good deeds and punished for his evil deeds.
The evil he did may be a cause of going astray as stated by Allah – the Mighty and Sublime:
“And if they turn away, then know that Allah is will to punish them for some sins of theirs.” (5:49).
Therefore, you should seek refuge with Allah from the evil of what you have done.
Then, “I acknowledge before You Your blessings bestowed on me.” That is, I admit and acknowledge your great favours which are innumerable!
“I confess my sins to You,” that is, I admit them. “So forgive me this sin for surely no one can forgive sin except you.”
You should endeavour to memorize this supplication, and adhere to it in the morning and in the evening. If you die during the day you will be among the dwellers of Paradise; and if you die during the night you will be among the dwellers of Paradise.
Thereafter, he mentioned the hadeeth of Thauban (may Allah be pleased with him) that whenever the Messenger of Allah ﷺ finished his Salat (Prayer), he would beg forgiveness three times [by saying, ‘Astagfirullah’ three times]. Then, he would say: ‘Allahumma Anta Salamu wa minka As-Salamu, tabarakta ya DhalJalali waL-Ikram (O Allah! You are the Bestower of security and security comes from You. Blessed are You, O Possessor of Glory and Honour).’ That is after he has said the Tasleem.
The first thing to say after Salam in an obligatory prayer is Astagfirullah three times. Why should you say Astagfirullah when you have just observed a Prayer and performed a good deed? This is because your good deed is not devoid of decrease and disorder. Therefore, you should seek forgiveness from Allah for whatever shortcomings that might have occurred in the course of the Prayer.
This is similar to those who still seek forgiveness from Allah after observing the optional night Prayer. Allah – the Mighty and Sublime-
said about them:
“And those who pray and ask Allah’s pardon in the last hours of the night.” (3:17).
Then you should say: “O Allah! You are the Bestower of security and security comes from You.” This means, You are free from every imperfection and defects. “...and safety is from You alone” that is, You are the source of safety. Had it not been for Allah, the Mighty and Sublime, we would not be in a state of safety and we would not be able to work, stand or sit.
“O Possessor of Glory and Honour.” The text does not contain the expression ‘wata ‘aalayta (You are High)’ but some other hadeeths contain: Yaa dhal-Jalaali wal-Ikraam. That is, Mighty and Great is Your Goodness, Blessings and Bounties on Your servants. One should endeavour to always say Astagfirullah three times after obligatory prayers and also add: “Allahumma antas-Salam wa minkas-Salam Tabarakta Yaa dhal-Jalaali wal-Ikraam.”