How to Erase Sins in Islam: A Complete Guide
Question

I am a muslim, married woman. I was born in a muslim family. But, I was not aware of islamic rules much. I did so many grave major sins that I feel like I am the worst person in this world. Now, I am trying to gain knowledge about my great religion, to obey its rulings. But, I don’t feel any peace and rest in my heart. I always feel like how would I know that Allah rabbul alamin has forgiven me? What good deed can I do so piles of my grave sins will be wiped out? How would I get close to my Lord? O Allah, show me your mercy on me.
I can’t sleep well, I can’t take rest, I don’t get any joy from anything. I always feel like I can die anytime and He will ask me questions, and I will reply to HIM, I don’t have anything to tell HIm. I am crying inside. Oh, Allah tell me how I would get free of all my sins.
I am writing to you as I have read your book “I want to repent, but..” several times. I get a little calm when I read that Allah says, “Despair not of the Mercy of Allah…” [Az-Zumar 39:53]. That is the only hope in my life.
I believe you are an islamic scholar. Do you believe Allah will forgive me for being such a sinner who did all kinds of sin in life? I have offered Salah of repentance and I am trying to change my lifestyle in every respect only to make my Lord satisfy me. I am committed that I will follow islamic rules for the rest of my life .
Praise be to Allah.Repentance; an Islamic perspective
Praise be to Allah Who has enabled you to repent and has guided you after you were misguided, Who has lighted the way for you and has made faith dear to you and made it attractive to you. To Him be all praise at all times.
We congratulate you on having been enabled to repent . This is a blessing for which thanks must be given, for Allah accepts the repentance of the one who repents.
The Promise of Forgiveness from Allah
You say, “How would I know whether Allah has forgiven me or not?”
You should note that whoever repents sincerely, Allah accepts his repentance and Allah is Oft-Forgiving, Most Merciful. He has promised the one who repents to Him that He will forgive him his sins. He says (interpretation of the meaning):
{Say: ‘O My slaves who have transgressed against themselves (by committing evil deeds and sins)! Despair not of the Mercy of Allah, verily, Allah forgives all sins. Truly, He is Oft-Forgiving, Most Merciful.’} [Az-Zumar 39:53]
When Allah promises something, He does not break His promise.
And Allah says (interpretation of the meaning):
{Except those who repent and believe (in Islamic Monotheism), and do righteous deeds; for those, Allah will change their sins into good deeds, and Allah is Oft-Forgiving, Most Merciful. And whosoever repents and does righteous good deeds; then verily, he repents towards Allah with true repentance.} [Al-Furqan 25:70-71]
In this verse, Allah tells us that He will replace the bad deeds of the one who repents into good deeds, and this is one of the blessings of repentance.
10 Ways to Erase Your Sins in Islam and Gain Mercy
You say, “How can I get rid of my sin?”
This is an important matter, for these are the means by which sin is expiated. Shaykh Al-Islam Ibn Taymiyah (may Allah have mercy on him) said: The punishment for sin is lifted from a person by means of ten things:

Repentance; this is agreed upon among the Muslims. Allah says (interpretation of the meanings):

{Say: ‘O My slaves who have transgressed against themselves (by committing evil deeds and sins)! Despair not of the Mercy of Allah, verily, Allah forgives all sins. Truly, He is Oft-Forgiving, Most Merciful.’} [Az-Zumar 39:53]
{Know they not that Allah accepts repentance from His slaves and takes the Sadaqat (alms, charity), and that Allah Alone is the One Who forgives and accepts repentance, Most Merciful?} [At-Tawbah 9:104]
{And He it is Who accepts repentance from His slaves, and forgives sins.} [Ash-Shura 42:25]

Praying for forgiveness . It was narrated by Al-Bukhari and Muslim that the Prophet (peace and blessings of Allah be upon him) said: “If a person commits a sin, then says, ‘O Lord, I have committed a sin so forgive me,’ He says, ‘My slave knows that he has a Lord Who may forgive sins or punish for it; I have forgiven My slave…’” (Narrated by Al-Bukhari, 6953 and Muslim, 4953)

In Sahih Muslim (2749), it is narrated that the Prophet (peace and blessings of Allah be upon him) said: “If you did not commit sin, Allah would do away with you and bring people who would commit sins then ask Him to forgive them, so He would forgive them.”

Doing good deeds which wipe out sins. Allah says (interpretation of the meaning):

{And perform As-Salah (Iqamat As-Salah), at the two ends of the day and in some hours of the night [i.e. the five compulsory Salah (prayers)]. Verily, the good deeds remove the evil deeds (i.e. small sins).” [Hud 11:114]
And the Prophet (peace and blessings of Allah be upon him) said: “The five daily prayers and Jumu`ah (Friday prayers) and Ramadan take away the bad deeds between one and the next, if you avoid major sins.” (Narrated by Muslim, 344)
And he said: “Whoever fasts Ramadan out of faith and the hope of reward, his previous sins will be forgiven.” (Narrated by Al-Bukhari, 37 and Muslim, 1268)
And he said: “Whoever spends the night of Laylat Al-Qadr in prayer out of faith and the hope of reward, his previous sins will be forgiven.” (Narrated by Al-Bukhari, 1768)
And he said: “Whoever performs Pilgrimage to this House, and does not behave in an obscene or immoral manner, he will go back free of sin like the day his mother gave birth to him.” (Narrated by Al-Bukhari, 1690)
And he said: “The expiation for the Fitnah caused to a man by his family, wealth and children is prayer, fasting, enjoining what is good and forbidding what is evil.” (Narrated by Al-Bukhari, 494 and Muslim, 5150)
And he said: “Whoever frees a believing slave, for each of (the slave’s) limbs Allah will free one of his limbs from the Fire…” (Narrated by Muslim, 2777)
These and similar Hadiths are narrated in the books of Sahih. And he said: “Charity extinguishes sin as water extinguishes fire, but malicious envy consumes good deeds as fire consumes wood.”

The Du`a of the believers for the believer , such as when they pray the funeral prayer for him. It was narrated from `Aishah and Anas ibn Malik that the Prophet (peace and blessings of Allah be upon him) said: “There is no Muslim who dies, and a group of Muslims numbering one hundred pray for him, all of them interceding for him, but their intercession for him will be accepted.” (Narrated by Muslim, 1576)

It was narrated that Ibn `Abbas (may Allah be pleased with him) said: “I heard the Messenger of Allah (peace and blessings of Allah be upon him) say: ‘There is no Muslim man who dies, and forty men pray the funeral prayer for him, not associating anything with Allah, but Allah will accept their intercession for him.’” (Narrated by Muslim, 1577) This refers to praying for him after he has died.

Good deeds which can be done for the deceased, such as giving in charity (on his behalf), etc. This will benefit him, according to the clear, authentic texts of the Sunnah and the consensus of the Imams. The same applies to freeing slaves and Hajj (on his behalf), indeed it was narrated by Al-Bukhari and Muslim that the Prophet (peace and blessings of Allah be upon him) said: “Whoever dies owing any (obligatory) fasts, his heir should fast them on his behalf.” (Narrated by Al-Bukhari, 5210 and Muslim, 4670)
The intercession of the Prophet (peace and blessings of Allah be upon him) and others on the Day of Resurrection for those who have committed sins. This is narrated in the uninterrupted Hadiths about intercession, such as the Hadith in which he (peace and blessings of Allah be upon him) said: “My intercession will be for those among my Ummah who have committed major sins.” (Classed as authentic by Al-Albani in Sahih Abu Dawud, 3965)

And he (peace and blessings of Allah be upon him) said: “I was given the choice between admitting half of my ummah to Paradise and intercession, and I chose intercession.” (See Sahih Al-Jami`, 3335)

Calamities by means of which Allah expiates sins in this world. It was narrated by Al-Bukhari and Muslim that the Prophet (peace and blessings of Allah be upon him) said: “No tiredness, exhaustion, worry, grief, distress or harm befalls a believer in this world, not even a thorn that pricks him, but Allah expiates some of his sins thereby.” (Narrated by Al-Bukhari, 5210 and Muslim, 4670)
The torment, squeezing and terror that happens in the grave. These are also things by means of which sins are expiated.
The horrors, distress and hardship of the Day of Resurrection.
The mercy and forgiveness of Allah , with no cause on the part of His slaves. (End quote from Majmu` Fatawa Ibn Taymiyah, vol. 7, p. 487-501)

Repenting with Hope and Fear
You ask, “Do you think that Allah will forgive me?”
Yes, He will, if you have repented sincerely, for Allah has promised to accept repentance, the evidence for which we have mentioned above.
Do not despair of the mercy of Allah. Remember the story of the man who killed one hundred people, then he repented and Allah accepted his repentance.
This is the story as narrated by Imam Muslim in his Sahih, in Kitab Al-Tawbah (2766): “It was narrated from Abu Sa`id Al-Khudri (may Allah be pleased with him) that the Prophet of Allah (peace and blessings of Allah be upon him) said: “Among the people who came before you there was a man who killed ninety-nine people, then he asked about the most knowledgeable person in the land. He was told about a monk, so he went to him and said, ‘I have killed ninety-nine people, can I repent?’ The monk said, ‘No.’ So he killed him, thus making the number one hundred.
Then he asked about the most knowledgeable person in the land, and he was told about a scholar, so he (went to him and) said: ‘I have killed one hundred people. Can I repent?’ He said, ‘Yes, who could stop you from repenting? Go to such and such a land, where there are people who worship Allah. Worship Allah with them and do not go back to your own land, for it is a bad land.’
So he set out, and when he was halfway there, death came upon him. The angels of mercy and the angels of punishment argued over him. The angels of mercy said, ‘He was coming repentant, turning with his heart towards Allah.’ The angels of punishment said, ‘He never did anything good.’
Then an angel came to them in human form and they accepted him as a mediator. He said, ‘Measure the distance between the two lands, and whichever he is closer to is where he belongs.’ So they measured the distance and found that he was closer to the land to which he was headed, so the angels of mercy took him.”
We learn several things from this Hadith, including the following:

That Allah forgives all the sins of one who repents, no matter how great they are. This is indicated by the verse in which Allah says (interpretation of the meaning):

{Say: ‘O ‘Ibadi (My slaves) who have transgressed against themselves (by committing evil deeds and sins)! Despair not of the Mercy of Allah, verily, Allah forgives all sins. Truly, He is Oft-Forgiving, Most Merciful.’}[Az-Zumar 39:53]

The one who repents has to keep away from bad friends who were committing the sin with him. He should keep company with righteous friends who will help him to do good and show him how to do it. We ask Allah to help us and you and to give us all strength. And Allah knows best.
The Muslim must live his life in a state between fear and hope, fearing his sins and not feeling safe from the Plan of Allah, and not being certain that he will enter Paradise. For the Companions (may Allah be pleased with them), even though they were so righteous and pious, were not like this, rather they feared their Lord and worshiped Him with fear and hope.

So the Muslim must obey Allah and repent and hope for the mercy of Allah, knowing that Allah forgives and accepts the repentance of the one who repents to Him, so he hopes that Allah will forgive him.  He knows that Allah accepts and loves the righteous deeds of His slave, so he strives to do righteous deeds hoping that they will be accepted. If he lives in this state, fearing his sins and hoping for the mercy of his Lord, he will strive to worship Him and keep away from sin, asking Allah to reward him for his righteous deeds until he meets Him when He is pleased with him, and he seeks refuge with Allah from his heart being turned away or his situation changing, as the Prophet (peace and blessings of Allah be upon him) used to pray, “O Controller of the hearts, make my heart steadfast in Your religion.”
We ask Allah to make you and us steadfast in His religion, and bestow more of His bounty upon us, for He is All-Hearing, Ever Near.
And Allah knows best.