Allah, the most exalted says :
“And those who do not invoke with Allah another deity or kill the soul which Allah has forbidden [to be killed], except by right, and do not commit unlawful sexual intercourse. And whoever should do that will meet a penalty. Multiplied for him is the punishment on the Day of Resurrection, and he will abide therein humiliated – Except for those who repent, believe and do righteous work. For them Allah will replace their evil deeds with good. And ever is Allah Forgiving and Merciful. And he who repents and does righteousness does indeed turn to Allah with [accepted] repentance”. [Quran 25 : 68 – 71]
Allah, the most high, also says: ‘Indeed, Allah loves those who are constantly repentant and loves those who purify themselves.” [Quran 2 : 222 ] and other verses and hadiths that confirm the importance of repentance.
As for the punishment for homosexuality, it is not compulsory to carry out any punishment, even if some scholars say otherwise and equate it to adultery/fornication, as they consider it as a form of adultery. No to forget that all scholars, have consensus on not revealing sin, so whoever commits a sin, and it has not been reported to the judge, it is incumbent on him to protect himself. It is better for one who catches him in the act not to expose him and he should not bear witness against him.
A Muslim should cover himself up and have a good thought of his Lord, for a sincere repentance is enough to wade off his sin and to cleanse the sinner by Allah’s mercy.
Oh! One seeking repentance, you are now cleansed from your sins, it is crucial not to return to your sin. It is not also compulsory on you to forget your sin, perhaps being conscious of your sins may lead you to humility and humbleness before your creator, then you will be seeking repentance from Him. You may always be conscious of your sin but do not despair of the mercy of Allah. No one despair of Allah’s mercy except those who are astray.