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:8:53

That is because Allah would not change a favor which He had bestowed upon a people until they change what is within themselves. And indeed, Allah is Hearing and Knowing.  

That, chastisement of the disbelievers, is because God would never change a grace that He had conferred on a people, substituting it with affliction, until they have changed that which is in themselves, ˹until˺ they have exchanged the grace conferred upon them for unbelief, in the way that the Meccan disbelievers exchanged their being ‘fed against hunger’, their being made ‘safe from fear’ ˹cf. Q. 106:4˺ and the sending of the Prophet (s) to them, for unbelief, ˹for˺ barring against the way of God and ˹for˺ fighting Muslims; and ˹know˺ that God is Hearing, Knowing.
القرآن:٨:٥٣

ذَٰلِكَ بِأَنَّ اللَّهَ لَمْ يَكُ مُغَيِّرًا نِعْمَةً أَنْعَمَهَا عَلَىٰ قَوْمٍ حَتَّىٰ يُغَيِّرُوا مَا بِأَنْفُسِهِمْ ۙ وَأَنَّ اللَّهَ سَمِيعٌ عَلِيمٌ  

{ذلك} أي تعذيب الكفرة {بأن} أي بسبب أن {الله لم يكُ مغيِّرا نعمة أنعمها على قوم} مبدلا لها بالنقمة {حتَّى يغيِّروا ما بأنفسهم} يبدلوا نعمتهم كفرا كتبديل كفار مكة إطعامهم من جوع وأمنُهم من خوف وبعْث النبي ﷺ إليهم بالكفر والصد عن سبيل الله وقتال المؤمنين {وأن الله سميع عليم}.