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:2:216

Fighting has been enjoined upon you while it is hateful to you. But perhaps you hate a thing and it is good for you; and perhaps you love a thing and it is bad for you. And Allah Knows, while you know not.  

Prescribed for you, obligatory ˹for you˺, is fighting, disbelievers, though it be hateful to you, by nature, because of the hardship involved. Yet it may happen that you hate a thing which is good for you; and it may happen that you love a thing which is bad for you: because the soul inclines towards those desires which result in its destruction and its rejection of the religious obligations that would bring about its happiness. Perhaps, then, even if you are averse to it, you will find much good in fighting, as a result of victory, booty, martyrdom or reward; while, if you were to reject fighting, even if you would like to do so, you will find much evil, because then you may be subjugated, impoverished and denied the reward; God knows, what is good for you, and you know, this, not, so strive in what He commands you.
القرآن:٢:٢١٦

كُتِبَ عَلَيْكُمُ الْقِتَالُ وَهُوَ كُرْهٌ لَكُمْ ۖ وَعَسَىٰ أَنْ تَكْرَهُوا شَيْئًا وَهُوَ خَيْرٌ لَكُمْ ۖ وَعَسَىٰ أَنْ تُحِبُّوا شَيْئًا وَهُوَ شَرٌّ لَكُمْ ۗ وَاللَّهُ يَعْلَمُ وَأَنْتُمْ لَا تَعْلَمُونَ  

{كُتِب} فرض {عليكم القتال} للكفار {وهو كُرْهٌ} مكروه {لكم} طبعا لمشقته {وعسى أن تكرهوا شيئا وهو خير لكم وعسى أن تحبوا شيئا وهو شر لكم} لميل النفس إلى الشهوات الموجبة لهلاكها ونفورها عن التكليفات الموجبة لسعادتها فلعل لكم في القتال وإن كرهتموه خيرا لأن فيه إما الظفر والغنيمة أو الشهادة والأجر وفي تركه وإن أحببتموه شرا لأن فيه الذل والفقر وحرمان الأجر {والله يعلم} ما هو خير لكم {وأنتم لا تعلمون} ذلك فبادروا إلى ما يأمركم به.