Muawiya bin Abu Sufyan reported,

I heard the Prophet ﷺ say, "Whoever Allah wishes good for, He grants him understanding of the religion. I am only one who distributes, and Allah is the One who gives. This nation will continue to uphold the command of Allah, and those who oppose them will not harm them, until the command of Allah comes."

Bukhari 71

Sahih

حدثنا سعيد بن عفير قال حدثنا ابن وهب عن يونس عن ابن شهاب قال قال حميد بن عبد الرحمن

سمعت معاوية خطيبا يقول

سمعت النبي ﷺ يقول من يرد الله به خيرا يفقهه في الدين وإنما أنا قاسم والله يعطي ولن تزال هذه الأمة قائمة على أمر الله لا يضرهم من خالفهم حتى يأتي أمر الله

البخاري 71صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Knowledge
Chapter
Whoever Allah intends good for, He gives him understanding in religion
Numbering
Darussalam 71
Bukhari 71