Hope is an optimistic state of mind that is based on an expectation of positive outcomes with respect to events and circumstances in one's life or the world at large.
Imam Jafar Al-Sadiq (AS) was asked a similar question by a person called Maisarah. Imam replied him: O Maisarah, keep on praying and nether think that the matter has been ruled out.
you should keep praying and seeking from Allah to grant you what He knows that it is good for you.
Allah The Glorious, The Forgiver, The Most Merciful, Most Compassionate Has kept the gate of repentance open for all sinners who really and sincerely repent and decide not to commit the sin again. If they do it again, the gate of forgiveness will not be closed if they sincerely repent.
Keep on seeking forgiveness and never loose hope in The Mercy of Allah.