The following are some statements of Prophet Muhammad (peace be upon him) on what deeds could lead to forgiveness of our past and future sins. The statements were collected in the book Al-Bihar Az-Zakhirah fi Asbab Al-Maghfirah
1. Perfecting one’s ablution
“No worshipper perfects his ablution except that his past and future sins are forgiven.” (Hasan, Al-Bazzar. Al-Haythami and Al-Mundhiri agreed upon.)
2. Fasting in Ramadan
“Whoever fasts Ramadan out of faith and seeking Allah’s reward then his past and future sins are forgiven.” (Ahmad)
3. Night prayer in Ramadan
“Whoever stands (in prayer) in Ramadan out of faith and seeking Allah’s reward then his past and future sins are forgiven.” (Sahih An-Nasa’i)
4. Night of Al-Qadr
Laylat-ul-Qadr or the Night of Al-Qadr can be expected in the odd nights of the last 10 days of Ramadan. He who performs the night prayer in it out of belief and seeking Allah’s reward his past and future sins are forgiven. (Ahmad)
5. Thanking Allah after eating and putting one’s clothes on
“Whoever ate food and then said, ‘Praise be to Allah who has fed me this food and provided it for me, without any strength or power on my part’, is forgiven his past (and future*) sins. And whoever wears a garment and says, ‘Praise be to Allah who has clothed me with this (garment) and provided it for me, without any strength or power on my part’, is forgiven his past and future sins.” (Ibn Majah, Abu Dawood, Al-Tirmidhi, An-Nasa’i, and others)
The addition marked by (*) is related by Abu Dawood. Sheikh Al-Albani declared it Hasan in Sahih Al-Jami (no. 6086).
6. Getting old in Islam
“No one reaches 40 years in Islam except that Allah protects him from madness, leprosy and leucoderma. When he is 50, Allah makes his reckoning easy. When he reaches 60, Allah grants him repentance. And when he reaches 70, Allah loves him and the inhabitants of the heavens love him. And when he reaches 80, Allah accepts his good deeds and overlooks his sins. When he reaches 90, Allah forgives his past and future sins, and he is named ‘the prisoner of Allah on earth’ and is granted intercession (for forgiveness) for his family.” (Hasan, Ibn Asakir. Ahmad Shakir said in his notes on Al-Musnad, 8/23, 25: “Its chain is at least Hasan. It is supported with other chains which raise it to the level of Sahih.”)
7. Neither Ruqya nor belief in bad omens
“I was told: ‘These are your people and amongst them there are 70,000 who shall enter Paradise without being taken to either account or torment.’ …’They are those who do not make Ruqya nor seek it, nor believe in bad omens, but trust in their Lord (Allah).’” (Al-Bukhari and Muslim)
8. Patiently bearing children’s death
“Whoever buries three children, Allah will forbid the (Hell) Fire for him.” (Sahih, Tabarani in Al-Kabeer, Al-Albani authenticated it in Sahih Al-Jami, no. 6238)
“There are no two Muslim parents whose three children die before reaching puberty except that Allah will enter them into Paradise due to His mercy to the children.
It will be said to them, ‘Enter the Paradise,’ so they will say, ‘Not until our parents enter first.’ It will be said, ‘Enter the Paradise you and your parents.’ (Ahmad and An-Nasa’i; Al-Albani authenticated it in Sahih Al-Jami, no. 5780)
“Whoever remains content and patient after the death of three of his offspring will enter Jannah.”
A woman said, “What about two?” The Prophet (peace be upon him) said, “And two.” (Sahih, An-Nasa’i and Ibn Hibban; authenticated by Al-Albani in Sahih Al-Jami, no. 5969)
For more please read here.