If good befalls you (O Muhammad), it grieves them, but if a calamity overtakes you, they say: “We took our precaution beforehand,” and they turn away rejoicing.
Meaning:-
Befalls: (of something bad) happen to someone, If something bad or dangerous befalls you, it happens to you.
Grieve: to feel or express great sadness, sorrow, mourn, upset, distress, pain, hurt
Calamity: an event causing great and often sudden damage or distress; a disaster.
Rejoice: feel or show great joy or delight.