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:13:42

And those before them had plotted, but to Allah belongs the plan entirely. He knows what every soul earns, and the disbelievers will know for whom is the final home.  

And indeed those that were before them, of communities, plotted, against their prophets just as they plot against you; but to God belongs all plotting. And nor is their plotting like the plotting of God, for, exalted be He, He knows what every soul earns, and so its requital is prepared for it, and this is the ultimate plotting, since He brings it to them whence they are not aware. The disbeliever (the genus is meant here; a variant reading has kuffār ˹‘the disbelievers’˺) shall assuredly know for whom shall be the sequel of the ˹heavenly˺ Abode, that is, the praiseworthy sequel in the abode of the Hereafter: will it be theirs or that of the Prophet (s) and his Companions?
القرآن:١٣:٤٢

وَقَدْ مَكَرَ الَّذِينَ مِنْ قَبْلِهِمْ فَلِلَّهِ الْمَكْرُ جَمِيعًا ۖ يَعْلَمُ مَا تَكْسِبُ كُلُّ نَفْسٍ ۗ وَسَيَعْلَمُ الْكُفَّارُ لِمَنْ عُقْبَى الدَّارِ  

{وقد مكر الذين من قبلهم} من الأمم بأنبيائهم كما مكروا بك {فلله المكر جميعا} وليس مكرهم كمكره لأنه تعالى {يعلم ما تكسب كل نفس} فيعد لها جزاءه وهذا هو المكر كله لأنه يأتيهم به من حيث لا يشعرون {وسيعلم الكافر} المراد به الجنس وفي قراءة الكفار {لمن عقبى الدار} أي العاقبة المحمودة في الدار الآخرة ألهم أم للنبي ﷺ وأصحابه.