Sayyiduna Mu'awiyah bin Abi Sufyan (may Allah be pleased with him) narrates that the Prophet (peace and blessings be upon him) said: "Indeed, Allah Almighty cannot be overpowered, nor can He be deceived, nor can He be informed of anything that He does not know. For whomever Allah Almighty intends good, He grants him understanding of the religion; and whomever He does not grant understanding of the religion, He pays no heed to him."
(Allamah al-Haythami says:) I say: Abu Ya'la recorded it, and this part of it is reported in the Sahih: "For whomever Allah Almighty intends good, He grants him understanding of the religion." Its chain contains al-Walid bin Muhammad al-Muwaqqari, who is da'if (weak).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب العلم / 860
Hadith Takhrij«أخرجه الامام احمد فى مسنده 93/4 اخرجه الامام الطبراني فى معجمه الكبير 369/19 اخرجه الامام ابو يعلى فى مسنده 7343 ، أخرجه صحيح البخاري برقم: 6882، وأخرجه سنن ابن ماجه برقم: 221، وأخرجه المعجم الأوسط للطبراني برقم: 9154»