Regarding seeking forgiveness, Shaykh Fawzan in explanation of the final verse of soorah an-Nasr said,
“It is better to complete ones lifespan with seeking and supplicating for forgiveness, because people, whether they are upon righteousness, uprightness and performance of righteous actions; then indeed they still have shortcomings regarding the right of Allah, so they should seek forgiveness. Subsequently it takes precedence and is obligatory for the sinful servant to seek and supplicate for forgiveness from Allah.
There is great virtue in seeking forgiveness and seeking of forgiveness is legislated to be done when completing righteous actions; when your life is approaching its end; when getting up from a gathering (1) and when completing the prayer.
On the authority of Thawbaan (may Allah be pleased with him), who said: When he had finished his prayer, the Messenger of Allah (ﷺ) used to ask for forgiveness three times and say: “Allaahumma anta al-salaam wa minka al-salaam, tabaarakta yaa dhaa’l-jalaali wa’l-ikraam (O Allaah, You are al-Salaam (the One Who is free from all defects and deficiencies) and from You is all peace, blessed are You, Possessor of Majesty and Honour).” (2)
Likewise he completes his life with asking for forgiveness, just (as he does at the end of each obligatory prayer) because seeking of forgiveness is sought after (at then end of an action, or one’s life).
Maa Tayyasara wa Tahassala min Duroos al-Quraan fee Hizb al-Mufassal pg. 527 with additional benefits from the recorded lesson.
(1)Sunan at-Tirmidhi 3433, Authenticated by Shaykh al-Albaani
(2) Muslim 135