Repentance Erases What Comes Before It
Question :
I am a young man, who in the past was negligent with the (obligatory) prayer and matters of religion, to the extent that days or weeks would pass without me praying.
But Allah Almighty has guided me through one of my friends.
Now I maintain the prayer and abide by Allah's rights. So what is the ruling concerning my shortcomings of the past regarding the prayer?
Answer:
You must express your gratitude to Allah Almighty for the favor, He has done for you, and praise Him for guiding you to repentance. There is no compensation required from you since repentance erases whatever precedes it as the Prophet ﷺ said. So what is required of you is true repentance, and sticking to repentance and being steadfast. Ask Allah Almighty for the assistance to do what is right, for guidance, and an increase in righteous deeds, and good will come to you by the will of Allah Almighty.
As for what happened in the past, true, sincere repentance erases it that which includes grief for what one has done in the past along with ceasing the acts of disobedience and true resolve not to return to them. This is what is obligatory upon you and all praise is to Allâh.
Source:
Ibn 'Uthaimin
Fatawa Islamiyah, Vol. 7 Pages 233-234