When you did not get what you wanted
You may hate a thing and it is better for you. The knowing is His, not yours.
كُتِبَ عَلَيْكُمُ ٱلْقِتَالُ وَهُوَ كُرْهٌ لَّكُمْ ۖ وَعَسَىٰٓ أَن تَكْرَهُوا۟ شَيْـًٔا وَهُوَ خَيْرٌ لَّكُمْ ۖ وَعَسَىٰٓ أَن تُحِبُّوا۟ شَيْـًٔا وَهُوَ شَرٌّ لَّكُمْ ۗ وَٱللَّهُ يَعْلَمُ وَأَنتُمْ لَا تَعْلَمُونَ
…wa ʿasā an takrahū shay'an wa huwa khayrun lakum, wa ʿasā an tuḥibbū shay'an wa huwa sharrun lakum.
“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 Allāh knows, while you know not.”
Source
The Qur'an · 2:216
Qur'an
- Qur'anic text in the Uthmani script via Quran.com; translation: Saheeh International