Each sin comes with the punishment and Allah will hold everyone accountable for what he/she did in this world and in his life. The punishment for a sin that a believer commits can be removed by following 10 ways.
1. Repentance: Seeking sincere repentance from the Allah aza wajal from the sin that a person committed, so Allah accepts his repentance, the one who repents is like the one who has no sin.
2. Istigfar: He who seeks forgiveness for the sins, so Allah forgives him.
The difference between the repentance and istigfar is that repenting means never to repeat the sin whereas istigfar means to acknowledge the wrongdoings and being ashamed of them in front of Allah, it means asking Allah for forgiveness.
3. Doing good deeds: Doing more good deeds erases sins and bad things committed by a person as good deeds erase the bad ones.
4. His believing brothers pray for him: The believing brothers of the sinners when praying for him for his sins during his life or death help him get sins removed.
5. A reward of Good deeds: Believing brothers when they [ask Allah] to bestow on him as a gift from the reward for their deeds, with which Allah benefits him.
6. Intercession: On the day of resurrection, Prophet Muhammad's (peace be upon him) intercession, by the will of Allah will help a person from his sins.
7. Paying with trials and tests: Allah tests the person with hardships which expiates his sins.
8. Punishment of Grave: Allah tests a person in the grave(al-Barzakh), the life in a grave between the day of death and the day of Judgement. The punishment of Grave will remove sins from the person.
9. Tests on the Day of Judgement: On the day of Judgement, Allah tests the person which expiates his sins.
10. Allah has mercy on him: Allah simply forgives him as he is most merciful and has mercy on those whom he wishes.
Whoever, then, is missed by these ten cannot blame anyone but himself.
And Allah knows best.