كُتِبَ عَلَيْكُمُ الْقِتَالُ وَهُوَ كُرْهٌ لَّكُمْ ۚ وَعَسٰٓى اَنْ تَكْرَهُوْا شَيْـًٔا وَّهُوَ خَيْرٌ لَّكُمْ ۚ وَعَسٰٓى اَنْ تُحِبُّوْا شَيْـًٔا وَّهُوَ شَرٌّ لَّكُمْ ۗ وَاللّٰهُ يَعْلَمُ وَاَنْتُمْ لَا تَعْلَمُوْنَ ࣖ ( البقرة: ٢١٦ )
Kutiba alaikumulqitaalu wa huwa kurhullakum wa 'asaaa an takrahoo shai'anw wa huwa khairullakum wa 'asaaa an tuhibbo shai'anw wa huwa sharrullakum; wallaahu ya'lamu wa antum laa ta'lamoon (al-Baq̈arah 2:216)
Battle 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. (Al-Baqarah  : 216)
1 Mufti Taqi Usmani
Fighting is enjoined upon you, while it is hard on you. It could be that you dislike something, when it is good for you; and it could be that you like something when it is bad for you. Allah knows, and you do not know.