كتاب الرقاق
To make the Heart Tender (Ar-Riqaq)
Chapter: To give up sinful deeds
باب الاِنْتِهَاءِ عَنِ الْمَعَاصِي
Sahih al-Bukhari 6482

Narrated Abu Musa:

Allah's Messenger (ﷺ) said. "My example and the example of the message with which Allah has sent me is like that of a man who came to some people and said, "I have seen with my own eyes the enemy forces, and I am a naked warner (to you) so save yourself, save yourself! A group of them obeyed him and went out at night, slowly and stealthily and were safe, while another group did not believe him and thus the army took them in the morning and destroyed them."

حَدَّثَنَا مُحَمَّدُ بْنُ الْعَلاَءِ، حَدَّثَنَا أَبُو أُسَامَةَ، عَنْ بُرَيْدِ بْنِ عَبْدِ اللَّهِ بْنِ أَبِي بُرْدَةَ، عَنْ أَبِي بُرْدَةَ، عَنْ أَبِي مُوسَى، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ مَثَلِي وَمَثَلُ مَا بَعَثَنِي اللَّهُ كَمَثَلِ رَجُلٍ أَتَى قَوْمًا فَقَالَ رَأَيْتُ الْجَيْشَ بِعَيْنَىَّ، وَإِنِّي أَنَا النَّذِيرُ الْعُرْيَانُ فَالنَّجَا النَّجَاءَ‏.‏ فَأَطَاعَتْهُ طَائِفَةٌ فَأَدْلَجُوا عَلَى مَهْلِهِمْ فَنَجَوْا، وَكَذَّبَتْهُ طَائِفَةٌ فَصَبَّحَهُمُ الْجَيْشُ فَاجْتَاحَهُمْ ‏"‏‏.‏
Reference : Sahih al-Bukhari 6482
In-book reference : Book 81, Hadith 71
USC-MSA web (English) reference : Vol. 8, Book 76, Hadith 489
  (deprecated numbering scheme)