Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:8:10

And Allah made it not but good tidings and so that your hearts would be assured thereby. And victory is not but from Allah. Indeed, Allah is Exalted in Might and Wise.  

And God appointed it, that is, the reinforcement, only as good tidings, and that your hearts might thereby be reassured. Victory comes only from God: surely God is Mighty, Wise.
القرآن:٨:١٠

وَمَا جَعَلَهُ اللَّهُ إِلَّا بُشْرَىٰ وَلِتَطْمَئِنَّ بِهِ قُلُوبُكُمْ ۚ وَمَا النَّصْرُ إِلَّا مِنْ عِنْدِ اللَّهِ ۚ إِنَّ اللَّهَ عَزِيزٌ حَكِيمٌ  

{وما جعله الله} أي الإمداد {إلا بشرى ولتطمئن به قلوبكم وما النصر إلا من عند الله إن الله عزيز حكيم}.

See similar narrations below:

Collected by Qurʾān
quran:3:126

And Allah made it not except as ˹a sign of˺ good tidings for you and to reassure your hearts thereby. And victory is not except from Allah, the Exalted in Might, the Wise -  

What God ordained, that is, of reinforcement, was only as a good tiding to you, of victory, and that your hearts might be at peace, ˹that˺ they might be at rest, and not be terrified by the large number of the enemy as compared to your small number. Victory comes only from God, the Mighty, the Wise, He gives it to whomever He will, and ˹victory comes˺ not because of a large army.
القرآن:٣:١٢٦

وَمَا جَعَلَهُ اللَّهُ إِلَّا بُشْرَىٰ لَكُمْ وَلِتَطْمَئِنَّ قُلُوبُكُمْ بِهِ ۗ وَمَا النَّصْرُ إِلَّا مِنْ عِنْدِ اللَّهِ الْعَزِيزِ الْحَكِيمِ  

{وما جعله الله} أي الإمداد {إلا بشرى لكم} بالنصر {ولتطمئن} تسكن {قلوبكم به} فلا تجزع من كثرة العدو وقلَّتكم {وما النصر إلا من عند الله العزيز الحكيم} يؤتيه من يشاء وليس بكثرة الجند.