A person came to Imam Ali (a) and said, “I seek God’s forgiveness.” The Imam replied, “Do you know what asking God’s forgiveness is?
Forgiveness is a word that stands on six supports.
- The first is to repent over the past.
- The second is to make a firm determination never to revert to it.
- The third is to discharge all the rights of people so that you may meet God quite clean with nothing which to account for.
- The fourth is to fulfill every obligation which you ignored in the past so that you may now be just with it.
- The fifth is to aim at the flesh grown as a result of unlawful earning so that you may melt it by grief of repentance till the skin touches the bone and a new flesh grows between them.
- the sixth is to make the body taste the pain of obedience as you previously made it taste the sweetness of disobedience. On such an occasion, you may say, ‘I seek God’s forgiveness.’” 
Merits of Repentance
The merits of repentance are greatly numerous. They are pictured in the holy Quran and pointed out in the texts of the Prophet and The Ahlul-Bayt (a). The Divine Care has refused to neglect the disobedient floundering in the glooms of sins without surrounding them with high sympathy and noble amnesty. The Lord therefore has drawn their attentions to the turning to Him and paved the way of repentance to them:
“When the faithful come to you, say to them, ‘Peace be upon you. Your Lord has decreed for Himself to be All-merciful. Anyone of you who commits a sin out of ignorance, then repents, and reforms himself will find that Allah is All-forgiving and All- merciful.’ (6:54)”
“(Muhammad), tell my servants who have committed injustice to themselves, “Do not despair of the mercy of Allah. Allah certainly forgives all sins. He is All-forgiving and All-merciful.” (39:53)”
“Ask forgiveness from your Lord; He is All- forgiving. He will send you abundant rain from the sky, strengthen you by (providing) you wealth and children, and make gardens and streams for you. (71:10-2)”
“Allah loves those who repent and those who purify themselves. (2:222)”
The Prophet (S) said: “The repentant from a sin is as same as him who did not commit it.”
“Nothing is more favorable to Allah than a male or female repentant believer.”
Istighfar of Prophets and the Infallible’s (a)
- Istighfar in their case is a way of teaching people how to ask for divine forgiveness.
- It might mean that they ask God to forgive them because of not doing what is recommended of them to do (rather than what is obliged for them), that is, something that had better do or not do.
- It might well mean asking God to forgive the sins of their people.
- If an infallible or a prophets attention is taken away from God to something of the Dunya then he seeks forgiveness from God for that i.e he lowered his attention from something greater to something lower and many times in the duas when the Imams are seeking forgiveness they mention this , they say ‘forgive me for letting my nafs overcome me and blinding myself from your omnipresence etc” and along those lines
 Nahj al-Balagha (The Peak of Eloquence), sermon #426.