Sayyiduna Abu Ayyub Ansari رضي الله عنه reported that Allah's Messenger (ﷺ) said:
‘By that being in whose control lies my soul, if you did not sin, Allah [Ta’ala] would have replaced you and brought a nation that would sin and then seek forgiveness from Allah. He would then forgive them.’
(Sahih Muslim 2749)
`The ‘Ulama have explained that this Hadith should not be understood as an encouragement to sin. Instead, it highlights Allah Ta’ala’s mercy and forgiveness. This Hadith should be viewed as an encouragement for wrongdoers who have sinned, to repent and make tawbah.`
`Just as Allah Ta’ala loves showing kindness to those who do good, He also loves forgiving those who have done wrong.
(Mirqat, Hadith: 2328; Also see: Faydul Qadir, Hadith: 7487)