(Al-Baqara) 2 : 37
فَتَلَقَّىٰ آدَمُ مِنْ رَبِّهِ كَلِمَاتٍ فَتَابَ عَلَيْهِ ۚ إِنَّهُ هُوَ التَّوَّابُ الرَّحِيمُ

Then Adam received words from His Lord, and He turned towards him; indeed, He is the Oft-relenting, the Merciful.

When Adam realized his offense and felt regression, the Lord who knows the state of chests put into his heart verse 7: 23 which says: “Our Lord! We have wronged to our soul, if You don’t forgive us and don’t grant Mercy, we’ll become losers”. Then by accepting Adam’s repentance, Lord selected him and guided him as told in verse 20: 122.