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:3:120

If good touches you, it distresses them; but if harm strikes you, they rejoice at it. And if you are patient and fear Allah, their plot will not harm you at all. Indeed, Allah is encompassing of what they do.  

If good fortune, a favour such as victory or booty, befalls you, it is evil for them, it grieves them; but if evil, such as defeat or drought, befalls you, they rejoice thereat (the conditional statement here is semantically connected to the previous conditional, and what comes in between is a parenthetical ˹statement˺, the meaning being that their enmity towards you is endless, so why do you befriend them? Avoid them!) Yet if you endure, their harm, and fear, God by ˹not˺ befriending them and so on, their guile will not hurt you (read either lā yadirkum or lā yadurrukum) at all; God encompasses what they do (ya‘malūn, or may be read ta‘malūn, ‘what you do’), He has knowledge of it and will requite them for it.
القرآن:٣:١٢٠

إِنْ تَمْسَسْكُمْ حَسَنَةٌ تَسُؤْهُمْ وَإِنْ تُصِبْكُمْ سَيِّئَةٌ يَفْرَحُوا بِهَا ۖ وَإِنْ تَصْبِرُوا وَتَتَّقُوا لَا يَضُرُّكُمْ كَيْدُهُمْ شَيْئًا ۗ إِنَّ اللَّهَ بِمَا يَعْمَلُونَ مُحِيطٌ  

{إن تَمْسَسْكُمْ} تصبكم {حسنة} نعمة كنصر وغنيمة {تسؤهم} تحزنهم} {وإن تصبكم سيئة} كهزيمة وجدب {يفرحوا بها} وجملة الشرط متصلة بالشرط قبل وما بينهما اعتراض والمعنى أنهم متناهون في عداوتكم فلم توالوهم فاجتنبوهم {وإن تصبروا} على أذاهم {وتتقوا} الله في موالاتهم وغيرها {لا يضركمْ} بكسر الضاد وسكون الراء وضمها وتشديدها {كيدهم شيئا إن الله بما يعلمون} بالياء والتاء {محيط} عالم فيجازيهم به.