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:9:39

If you do not go forth, He will punish you with a painful punishment and will replace you with another people, and you will not harm Him at all. And Allah is over all things competent.  

If (illā: lā has been assimilated with the nūn of the conditional particle in, in both instances ˹here and in the next verse˺) you do not go forth, ˹if you do not˺ set out with the Prophet (s) for the struggle, He will chastise you with a painful chastisement, and He will substitute ˹you with˺ another folk other than you, that is, He will bring them in your place, and you will not hurt Him, that is, God, or ˹‘him’ as being˺ the Prophet (s), at all, should you neglect to help him ˹to victory˺, for God ˹Himself˺ will indeed bring victory to His religion; for God has power over all things, including bringing victory to His religion and His Prophet.
القرآن:٩:٣٩

إِلَّا تَنْفِرُوا يُعَذِّبْكُمْ عَذَابًا أَلِيمًا وَيَسْتَبْدِلْ قَوْمًا غَيْرَكُمْ وَلَا تَضُرُّوهُ شَيْئًا ۗ وَاللَّهُ عَلَىٰ كُلِّ شَيْءٍ قَدِيرٌ  

{إلاّ} بإدغام لا في نون إن الشرطية في الموضعين {تنفروا} تخرجوا مع النبي ﷺ للجهاد {يعذبكم عذابا أليما} مؤلماً {ويستبدل قوما غيركم} أي يأت بهم بدلكم {ولا تضروه} أي الله أو النبيَّ ﷺ {شيئا} بترك نصره فإن الله ناصر دينه {والله على كل شيء قدير} ومنه نصر دينه ونبيه.