Language:
كتاب القدر
82
Divine Will (Al-Qadar)
(16)
Chapter: "... Never could we have found guidance, were it not that Allah had guided us ..."
(16)
بَابُ: {وَمَا كُنَّا لِنَهْتَدِيَ لَوْلاَ أَنْ هَدَانَا اللَّهُ}
Sahih al-Bukhari 6620

Narrated Al-Bara' bin `Azib:

I saw the Prophet (ﷺ) on the Day of (the battle of) Al-Khandaq, carrying earth with us and saying, "By Allah, without Allah we would not have been guided, neither would we have fasted, nor would we have prayed. O Allah! Send down Sakina (calmness) upon us and make our feet firm when we meet (the enemy). The pagans have rebelled against us, but if they want to put us in affliction (i.e., fight us) we refuse (to flee)." (See Hadith No. 430, Vol. 5).

حَدَّثَنَا أَبُو النُّعْمَانِ، أَخْبَرَنَا جَرِيرٌ ـ هُوَ ابْنُ حَازِمٍ ـ عَنْ أَبِي إِسْحَاقَ، عَنِ الْبَرَاءِ بْنِ عَازِبٍ، قَالَ رَأَيْتُ النَّبِيَّ صلى الله عليه وسلم يَوْمَ الْخَنْدَقِ يَنْقُلُ مَعَنَا التُّرَابَ وَهْوَ يَقُولُ ‏ "‏ وَاللَّهِ لَوْلاَ اللَّهُ مَا اهْتَدَيْنَا، وَلاَ صُمْنَا وَلاَ صَلَّيْنَا، فَأَنْزِلَنْ سَكِينَةً عَلَيْنَا، وَثَبِّتِ الأَقْدَامَ إِنْ لاَقَيْنَا، وَالْمُشْرِكُونَ قَدْ بَغَوْا عَلَيْنَا، إِذَا أَرَادُوا فِتْنَةً أَبَيْنَا‏"‏‏.‏
Reference : Sahih al-Bukhari 6620
In-book reference : Book 82, Hadith 26
USC-MSA web (English) reference : Vol. 8, Book 77, Hadith 617
  (deprecated numbering scheme)