But to those who do evil in ignorance and then after that repent and put things right, to them your Lord is Ever-Forgiving, Most Merciful. (Surat an-Nahl, 119)
Having a grasp of the importance of sincerity towards Allah leads one not to falter in turning to Him, and to repent and seek His forgiveness, no matter what the wrongdoing may be. This is example of Allah's infinite mercy, as recounted in the Qur'an:
Anyone who does evil or wrongs himself and then asks Allah's forgiveness will find Allah Ever-Forgiving, Most Merciful. (Surat an-Nisa', 110)
Allah grants His servants the opportunity to make amends for any wrongdoing. In Allah's sight, what matters is not the significance or insignificance of the wrongdoing, but one's sincerity. This is certainly a great mercy bestowed upon believers:
Those who, when they act indecently or wrong themselves, remember Allah and ask forgiveness for their bad actions—for who can forgive bad actions except Allah?—and do not knowingly persist in what they were doing. (Surah Al 'Imran, 135)
Believers must acknowledge that no matter how serious a mistake may be—even the greatest offence one could possibly imagine, turning to Allah with a sincere repentance will relieve that person of his burden.
It may well be that a person had disbelieved all through his life, until that very moment. He may have pursued only his whims and desires. However, in return for one's repentance for his wrongdoings, following a firm and sincere resolve never to commit the same error again, one can always hope for Allah's forgiveness. Remember that to enjoy the relief from the burden of the offences committed against Allah only takes a moment through sincere repentance and is the only way to salvation. Basically, a person needs to only keep his promise to Allah and be sincere to Him:
Allah only accepts the repentance of those who do evil in ignorance and then quickly make repentance after doing it. Allah turns towards such people. Allah is All-Knowing, All-Wise. There is no repentance for people who persist in doing evil until death comes to them and who then say, "Now I make repentance," nor for people who die disbelievers. We have prepared for them a painful punishment. (Surat an-Nisa', 17-18)
No matter what the sin may be, never forget to turn to Allah in repentance. Keeping in mind that death may come upon you at any moment, bringing to a sudden end any further opportunity to repent, ask for forgiveness now.
Certainly, it is difficult except for the humble (Surat al-Baqara: 45); but remember that such people will enter Hell abjectly (Surah Ghafir: 60), and be dragged face-first into the Fire (Surat al-Qamar: 48). On that day they will be banned from the presence of their Lord; Allah will neither speak to them nor purify them...
Except for those who repent and believe and act rightly: Allah will transform the wrong actions of such people into good—Allah is Ever-Forgiving, Most Merciful—for certainly all who make repentance and act rightly have turned sincerely towards Allah. (Surat al-Furqan, 70-71)