Istighfar
Istighfar ( ), is the act of seeking forgiveness from Allah, usually by saying ʾastaġfiru -llāh (). A longer variant is ʾastaġfiru -llāha rabbī wa-ʾatūbu ʾilayh () which means "Verily, I seek the forgiveness of God, who is my Lord and Sustainer, and I turn to Him in repentance". It is considered one of the essential parts of worship in Islam. Etymology
"Istighfar" is derived from the Arabic root , which is related to the covering of a thing with that which will keep it clean. Meaning
"Istighfar" means to pray to Allah that he may protect the supplicant from worldly desires, both in this world and the hereafter. Astaghfirullah literally translates to "I seek forgiveness in God". Usually, a Muslim recites it as part of dhikr, that is to say that Allah is the greatest or that goodness comes from Allah. The phrase can also be used in popular culture when seeing something wrong or shameful. Purpose 
Islam posits that human beings were created by God, with the ability to choose their own actions; either to do good deeds and obey Allah or to do evil deeds and disobey (Him). However, as a result of human error, God offered humans who might have mistakenly committed sin or submitted to their desires and ignored the dictates of their conscience to perform istighfar. Thus, Muslims use istighfar as they believe it counters Shaytan who tries to lead them into hell by inviting them to sin. In the Qur'an
Istighfar, and some other words from the same root such as Ghafir, Al-Ghafoor, Ghaffar, occur in the Qur'an more than seventy times. Quranic verses regarding istighfar
In the Qur'an, there are numerous verses on the issue of istighfar, in which Allah commands the believers to always seek his forgiveness and turn to Him. Some examples of these verses are:

 "And those who, when they commit an immorality or wrong themselves [by transgression], remember Allah and seek forgiveness for their sins – and who can forgive sins except Allah? – and [who] do not persist in what they have done while they know." (Al Quran 3:135) 
"Those – their reward is forgiveness from their Lord and gardens beneath which rivers flow [in Paradise], wherein they will abide eternally; and excellent is the reward of the [righteous] workers." (Al Quran 3:136) 
 "Whoever commits evil or wrongs themselves then seeks Allah's forgiveness will certainly find Allah All-Forgiving, Most Merciful." (Al Quran 4:110) 
 "So will they not repent to Allah and seek His forgiveness? And Allah is Forgiving and Merciful." (Al Quran 5:74) 
 "And seek your Lord's forgiveness and turn to Him in repentance. He will grant you a good provision for an appointed term and graciously reward the doers of good. But if you turn away, then I truly fear for you the torment of a formidable Day." (Al Quran 11:3)  
 "And return to your Lord time after time and submit to Him before there comes to you the punishment, then you shall not be helped." (Al Quran 39:54) 
"O you who have believed, repent to Allah with sincere repentance. Perhaps your Lord will remove from you your misdeeds and admit you into gardens beneath which rivers flow [on] the Day when Allah will not disgrace the Prophet and those who believed with him. Their light will proceed before them and on their right; they will say, 'Our Lord, perfect for us our light and forgive us. Indeed, You are over all things competent. (Al Quran 66:8)

In sunnah
 In hadith, it was reported that: "The Prophet sought the forgiveness (Istighfar) from Allah, frequently and on daily basis." "The Prophet is spoken of in a hadith as saying Istighfar multiple times a day, despite his infallibility." The prophet used to seek forgiveness in the morning and night. The prophet said: "The more one prays for pardoning of his sins the more good deeds will be credited to his account and on the Day of Judgement his deeds will appear shining." Among the sunnah of the Prophet was that: "He never got up even from the smallest meeting without reciting Istighfar." Another Hadith also mentions that: "The Holy Prophet recited 'Astaghfirullah Wā tūbo ilaih' many times every day." Significance
 Istighfar safeguards the supplicant against the evil consequences of their sins. Istighfar increases the blessings of Allah (both material and spiritual). Istighfar is one of the ways of finding inner peace and tranquillity. Istighfar purifies ones from the physiological results of sins. Istighfar turns evil deeds to good deeds. Istighfar paves way for the acceptance of prayer. Allah forgives those who sincerely seek forgiveness unconditionally. The Prophet said: "Whoever makes Istighfar frequently, Allah will provide a way for him out of every distress and provide for him from sources he could never expect". powerful-duas-for-forgiveness

Conditions for istighfar
Seeking forgiveness has three conditions, with an additional fourth one if the sin involves the violation of another person's rights:

 To discontinue the sin
 To regret having committed it 
 To resolve to never return to the sin
 To restore the rights of the person that has been wronged. Etiquette
Among the etiquette of seeking forgiveness are: 
 Istighfar during the dawn (sahar  – the late time of night before the daylight – time before daybreak). Istighfar the eve before or during Jumu'ah. To recognize one has wronged. Confession (to God) of one's mistakes. (If necessary confession to the person involved)  
 Testimony of faith and submission to God. Stop the sin, regret the sin, repent and intend to never do it again. Note: Istighfar can be done at any time, above mentioned are a few Sunnahs followed by Prophet Muhammed's teachings. Istighfar of prophets
The Istighfar of an ordinary person was not a special case since they are not infallible. However, in the case of the prophets and angels, such an act may be interpreted otherwise, because  it contradicts the attributes of infallibility in the prophets. Though, there is some relevant evidence showing the fact that prophets and angels were also engaged in asking for divine forgiveness. "The heavens nearly burst, one above the other, ˹in awe of Him˺. And the angels glorify the praises of their Lord, and seek forgiveness for those on earth. Surely Allah alone is the All-Forgiving, Most Merciful." (Al Quran 42:5)

Related invocations

References

Confession (religion)
Arabic words and phrases
Quranic words and phrases