Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:9:50

If good befalls you, it distresses them; but if disaster strikes you, they say, "We took our matter ˹in hand˺ before," and turn away while they are rejoicing.  

If good fortune, such as a victory or ˹a taking of˺ some spoils, befalls you, it vexes them; but if an affliction, some hardship, befalls you, they say, ‘We took our precaution, judiciously — when we stayed behind — before’, before this act of disobedience; and they turn away, rejoicing, at what has afflicted you.
القرآن:٩:٥٠

إِنْ تُصِبْكَ حَسَنَةٌ تَسُؤْهُمْ ۖ وَإِنْ تُصِبْكَ مُصِيبَةٌ يَقُولُوا قَدْ أَخَذْنَا أَمْرَنَا مِنْ قَبْلُ وَيَتَوَلَّوْا وَهُمْ فَرِحُونَ  

{إن تصبك حسنة} كنصر وغنيمة {تسؤهم وإن تصبك مصيبة} شدة {يقولوا قد أخذنا أمرنا} بالحزم حين تخلفنا {من قبل} قبل هذه المعصية {ويتولَّوا وهم فرحون} بما أصابك.