The Quran tells sinners: do not despair of the mercy of Allah, for He forgives all sins (39:53). Allah says, "I am as My servant thinks of Me." The Prophet ﷺ said Allah's mercy overcomes His anger.
From the Quran
۞ قُلْ يَـٰعِبَادِىَ ٱلَّذِينَ أَسْرَفُوا۟ عَلَىٰٓ أَنفُسِهِمْ لَا تَقْنَطُوا۟ مِن رَّحْمَةِ ٱللَّهِ ۚ إِنَّ ٱللَّهَ يَغْفِرُ ٱلذُّنُوبَ جَمِيعًا ۚ إِنَّهُۥ هُوَ ٱلْغَفُورُ ٱلرَّحِيمُ ﴿53﴾
Say, "O My servants who have transgressed against themselves [by sinning], do not despair of the mercy of Allāh. Indeed, Allāh forgives all sins.[1354] Indeed, it is He who is the Forgiving, the Merciful."
Az-Zumar 39:53قَالَ وَمَن يَقْنَطُ مِن رَّحْمَةِ رَبِّهِۦٓ إِلَّا ٱلضَّآلُّونَ ﴿56﴾
He said, "And who despairs of the mercy of his Lord except for those astray?"
Al-Hijr 15:56يَـٰبَنِىَّ ٱذْهَبُوا۟ فَتَحَسَّسُوا۟ مِن يُوسُفَ وَأَخِيهِ وَلَا تَا۟يْـَٔسُوا۟ مِن رَّوْحِ ٱللَّهِ ۖ إِنَّهُۥ لَا يَا۟يْـَٔسُ مِن رَّوْحِ ٱللَّهِ إِلَّا ٱلْقَوْمُ ٱلْكَـٰفِرُونَ ﴿87﴾
O my sons, go and find out about Joseph and his brother and despair not of relief from Allāh. Indeed, no one despairs of relief from Allāh except the disbelieving people."
Yusuf 12:87۞ وَٱكْتُبْ لَنَا فِى هَـٰذِهِ ٱلدُّنْيَا حَسَنَةً وَفِى ٱلْـَٔاخِرَةِ إِنَّا هُدْنَآ إِلَيْكَ ۚ قَالَ عَذَابِىٓ أُصِيبُ بِهِۦ مَنْ أَشَآءُ ۖ وَرَحْمَتِى وَسِعَتْ كُلَّ شَىْءٍ ۚ فَسَأَكْتُبُهَا لِلَّذِينَ يَتَّقُونَ وَيُؤْتُونَ ٱلزَّكَوٰةَ وَٱلَّذِينَ هُم بِـَٔايَـٰتِنَا يُؤْمِنُونَ ﴿156﴾
And decree for us in this world [that which is] good and [also] in the Hereafter; indeed, we have turned back to You." [Allāh] said, "My punishment - I afflict with it whom I will, but My mercy encompasses all things." So I will decree it [especially] for those who fear Me and give zakāh and those who believe in Our verses-
Al-A'raf 7:156إِنَّ ٱلَّذِينَ ءَامَنُوا۟ وَٱلَّذِينَ هَاجَرُوا۟ وَجَـٰهَدُوا۟ فِى سَبِيلِ ٱللَّهِ أُو۟لَـٰٓئِكَ يَرْجُونَ رَحْمَتَ ٱللَّهِ ۚ وَٱللَّهُ غَفُورٌ رَّحِيمٌ ﴿218﴾
Indeed, those who have believed and those who have emigrated and fought in the cause of Allāh - those expect the mercy of Allāh. And Allāh is Forgiving and Merciful.
Al-Baqarah 2:218
From the hadith
Abu Hurairah narrated that the Messenger of Allah (s.a.w) said:"Indeed Allah Most High says: 'I am as My slave thinks of Me, and I am with him when He calls upon Me
Jabir b. 'Abdullah al-Ansari reported:I heard Allah's Messenger (ﷺ) say three days before his death: None of you should die but hoping only good from Allah, the Exalted and Glorious
Sahih Muslim 2877SahihNarrated Abu Huraira:I heard Allah's Messenger (ﷺ) saying, Verily Allah created Mercy. The day He created it, He made it into one hundred parts. He withheld with Him ninety-nine parts, and sent its one part to all His creatures. Had the non-believer known of all the Mercy which is in the Hands of Allah, he would not lose hope of entering Paradise, and had the believer known of all the punishment which is present with Allah, he would not consider himself safe from the Hell-Fire
Narrated Abu Huraira:The Prophet (ﷺ) said, "When Allah created the Creation, He wrote in His Book--and He wrote (that) about Himself, and it is placed with Him on the Throne--'Verily My Mercy overcomes My Anger
Quran: the Arabic Uthmani text from Tanzil.net (CC BY 3.0); English, Saheeh International, from QuranEnc.com.
Hadith: the English and the grades from the open hadith dataset (fawazahmed0/hadith-api), the same narrations MuslimGPT checks every quote against. Each one opens its own page with the Arabic.
The introduction is ours. For a ruling on your own situation, ask a scholar you trust.