USC-MSA web (English) : Book 46, Hadith 8
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
وَحَدَّثَنِي عَنْ مَالِكٍ، عَنْ يَزِيدَ بْنِ زِيَادٍ، عَنْ مُحَمَّدِ بْنِ كَعْبٍ الْقُرَظِيِّ، قَالَ قَالَ مُعَاوِيَةُ بْنُ أَبِي سُفْيَانَ وَهُوَ عَلَى الْمِنْبَرِ أَيُّهَا النَّاسُ إِنَّهُ لاَ مَانِعَ لِمَا أَعْطَى اللَّهُ وَلاَ مُعْطِيَ لِمَا مَنَعَ اللَّهُ وَلاَ يَنْفَعُ ذَا الْجَدِّ مِنْهُ الْجَدُّ مَنْ يُرِدِ اللَّهُ بِهِ خَيْرًا يُفَقِّهْهُ فِي الدِّينِ . ثُمَّ قَالَ مُعَاوِيَةُ سَمِعْتُ هَؤُلاَءِ الْكَلِمَاتِ مِنْ رَسُولِ اللَّهِ صلى الله عليه وسلم عَلَى هَذِهِ الأَعْوَادِ .
Yahya related to me from Malik from Yazid ibn Ziyad that Muhammad ibn Kab al-Quradhi said, ''Muawiya ibn Abi Sufyan said from the mimbar, 'O people! Nothing keeps away what Allah gives and nothing gives what Allah keeps away. The earnestness of the earnest one does not profit him. When Allah desires good for him, he gives him understanding in the deen.' Then Muawiya said, 'I heard these words from the Messenger of Allah (ﷺ) on these blocks of wood.' "
Full reference and source
USC-MSA web (English) : Book 46, Hadith 8 Arabic : Book 46, Hadith 1633
View source on Sunnah.com (opens in a new tab)