Sure Al-Baqara

2:216

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

Vorgeschrieben ist euch zu kämpfen, obwohl es euch zuwider ist. Aber vielleicht ist euch etwas zuwider, während es gut für euch ist, und vielleicht ist euch etwas lieb, während es schlecht für euch ist. Allah weiß, ihr aber wißt nicht.

Tafsir 2:216

Fighting in Allah’s path has been chosen for believers even though it is something that is naturally disliked, because it means risking one’s life and wealth. However, you may dislike something when, it is good and beneficial. An example of this is striving in Allah’s path, which means – in addition to the great reward – the defeat of the enemy and promotion of Allah’s word. On the other hand, you may like something whilst it is bad and harmful to you, such as holding back from fighting: this will result in you being defeated and the enemy’s gaining authority over you. Allah knows full well what is good and what is not, whereas you do not. Therefore, follow His instruction which is better for you.