The Prayer of Repentance is also known by Salah al-Istighfar or Salah al-Tawba.
Allah Most High says, “Turn towards Allah, O believers, every one of you, so that you may be successful.” [Quran, 24:31]
The best repentance is to resolve not to return to such matters, and to turn to Allah, expressing one’s remorse with one’s own heartfelt words.
The prayer of repentance for a transgression (ma’siyah) which a person commits.
Therefore, it is recommended to make this prayer when you make a mistake.
Sayyiduna Abu Bakr related from the Messenger of Allah (Allah bless him and give him peace) that he said, “There is no one who commits a sin, goes and performs ritual ablutions, and then prays two rak‘as without being heedless after which they seek Allah’s forgiveness except that He forgives them.” [Abu Dawud]
After this, he (peace and blessings be upon him) recited Allah Most High’s words, “And those who, when they do an evil thing or wrong themselves, remember Allah and implore forgiveness for their sins – Who forgives sins save Allah only? – and will not knowingly repeat (the wrong) they did.” [Quran, 3:135]
This has been related by Abu Dawud and Tirmidhi in their respective Sunan, and the scholars declared it to be a recommended prayer. [Ibn Qudama, al-Mughni 1/348; Ibn Abidin, Radd al-Muhtar 2/28, quoting Sharh Shir‘at al-Islam via Shaykh Isma‘il al-Nabulsi]
This hadith is an amazing gift and also a reminder that one’s actions have consequences. The scholars also recommend that if one is trying to remove a bad habit, impose a small fine upon oneself to annoy the nafs, and stick to it. For example, every time you lie then pay $5 in charity.
For the Shadhili salah al-tawba has higher degrees of significance, as a practical means to purifying oneself constantly, as mentioned in Repentance (tawba).
Always intend to be sincere in doing away with the sin in one’s intention. As for “sincere repentance” (tawbaatan nasuhan) [reference to Quran 66:8], it is comrpised of four things: to ask forgiveness for sin with our voices, to abstain from it with our bodies, to rid our hearts from any desire to persist in it, and to stay away from bad companionins. Sufyan al-Thawri said, “The signs of sincere repentance are four: meagerness, weakness, humility, and solitude.”
Pray the Salah at-Tawba by making then intention for it. Then commence with two rakat of prayer.
Recite Surah al-Asr and Ikhlas. In jalasah and both sujuds recite Sayyidul Istighfar three times each. Also, make any internal supplication for sincere tawba, and to remove the habitual sin. Make salaams, put hands up for dua and again recite the Sayyidul Istighfar and similar dua for breaking habitual sin.
Sayyidul Istighfar Arabic
اللَّهُمَّ أَنْتَ رَبِّي، لَا إِلٰهَ إِلَّا أَنْتَ، خَلَقْتَنِي وَأَنَا عَبْدُكَ، وَأَنَا عَلَىٰ عَهْدِكَ وَوَعْدِكَ مَا اسْتَطَعْتُ، أَعُوذُ بِكَ مِنْ شَرِّ مَا صَنَعْتُ، أَبُوءُ لَكَ بِنِعْمَتِكَ عَلَيَّ، وَأَبُوءُ بِذَنْبِي، فَاغْفِرْ لِي فَإِنَّهُ لَا يَغْفِرُ الذُّنُوبَ إِلَّا أَنْتَ.
If one has not memorized the Sayyidul Istighfar then recite the ending istighfar from the Wirdul Aam, which goes as follows:
Level Three Istighfar
أَسْتَغْفِرُ اللَّهَ الْعَظِيمَ الَّذِي لَا إِلٰهَ إِلَّا هُوَ الْحَيُّ الْقَيُّومُ وَأَتُوبُ إِلَيْهِ.
In the Hurdle of Repentance in Minhal al-Abideen by Imam al-Ghazali, he outlines a full process for Salah at-Tawba. For example, he recommends to add the supplication of distress (dua ash-shidda) to one’s dua.
See also: The Prayer of Need (Salah Al-Haja).