كتاب التوبة
50  
The Book of Repentance
(2)
Chapter: Sins Are Erased By Praying For Forgiveness And Repenting
(2)
باب سُقُوطِ الذُّنُوبِ بِالاِسْتِغْفَارِ تَوْبَةً ‏‏
Sahih Muslim 2748 b

Abu Ayyub Ansari reported that Allah's Messenger (ﷺ) said:

If you were not to commit sins, Allah would have swept you out of existence and would have replaced you by another people who have committed sin, and then asked forgiveness from Allah, and He would have granted them pardon.
حَدَّثَنَا هَارُونُ بْنُ سَعِيدٍ الأَيْلِيُّ، حَدَّثَنَا ابْنُ وَهْبٍ، حَدَّثَنِي عِيَاضٌ، - وَهُوَ ابْنُ عَبْدِ اللَّهِ الْفِهْرِيُّ - حَدَّثَنِي إِبْرَاهِيمُ بْنُ عُبَيْدِ بْنِ رِفَاعَةَ، عَنْ مُحَمَّدِ بْنِ كَعْبٍ الْقُرَظِيِّ، عَنْ أَبِي صِرْمَةَ، عَنْ أَبِي أَيُّوبَ الأَنْصَارِيِّ، عَنْ رَسُولِ اللَّهِ صلى الله عليه وسلم أَنَّهُ قَالَ ‏ "‏ لَوْ أَنَّكُمْ لَمْ تَكُنْ لَكُمْ ذُنُوبٌ يَغْفِرُهَا اللَّهُ لَكُمْ لَجَاءَ اللَّهُ بِقَوْمٍ لَهُمْ ذُنُوبٌ يَغْفِرُهَا لَهُمْ ‏"‏ ‏.‏
Reference : Sahih Muslim 2748b
In-book reference : Book 50, Hadith 12
USC-MSA web (English) reference : Book 37, Hadith 6621
  (deprecated numbering scheme)