لِّكَيْلَا تَأْسَوْا۟ عَلَىٰ مَا فَاتَكُمْ وَلَا تَفْرَحُوا۟ بِمَآ ءَاتَىٰكُمْ ۗ وَٱللَّهُ لَا يُحِبُّ كُلَّ مُخْتَالٍ فَخُورٍ
Asad Quran Translation
[Know this,] so that you may not despair over whatever [good] has escaped you nor exult [unduly] over whatever [good] has come to you:37
for, God does not love any of those who, out of self-conceit, act in a boastful manner38
Thus, the knowledge that whatever has happened had to happen - and could not have not happened - because, obviously, it had been willed by God in accordance with His unfathomable plan, ought to enable a true believer to react with conscious equanimity to whatever good or ill comes to him.
I.e., attributing their good fortune to their own merit or "luck".
Malik Quran Translation
This is done so that you may not grieve for the things that you miss, or be overjoyed at what you gain; for Allah does not love any vainglorious boaster,
Yusuf Ali Quran Translation
In order that ye may not despair over matters that pass you by nor exult over favors bestowed upon you. For Allah loveth not any vainglorious boaster 5310
In the external world, what people may consider misfortune or good fortune may both turn out to be illusory,-in Kipling's words, "both imposters just the same". The righteous man does not grumble if some one else has possessions, nor exult if he has them. He does not covet and he does not boast. If he has any advantages, he shares them with other people, as he considers them not due to his own merits, but as gifts of Allah.
Mustafa Khattab Quran Translation
˹We let you know this˺ so that you neither grieve over what you have missed nor boast over what He has granted you. For Allah does not like whoever is arrogant, boastful—
Piktal Quran Translation
That ye grieve not for the sake of that which hath escaped you, nor yet exult because of that which hath been given. Allah loveth not all prideful boasters,
Likayla tasaw AAala ma fatakum wala tafrahoo bima atakum waAllahu la yuhibbu kulla mukhtalin fakhoorin