Sahih al-Bukhari 7307
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
إِنَّ اللَّهَ لاَ يَنْزِعُ الْعِلْمَ بَعْدَ أَنْ أَعْطَاهُمُوهُ انْتِزَاعًا، وَلَكِنْ يَنْتَزِعُهُ مِنْهُمْ مَعَ قَبْضِ الْعُلَمَاءِ بِعِلْمِهِمْ، فَيَبْقَى نَاسٌ جُهَّالٌ يُسْتَفْتَوْنَ فَيُفْتُونَ بِرَأْيِهِمْ، فَيُضِلُّونَ وَيَضِلُّونَ "
Narrated `Abdullah bin `Amr:
I heard the Prophet (ﷺ) saying, "Allah will not deprive you of knowledge after he has given it to you, but it will be taken away through the death of the religious learned men with their knowledge. Then there will remain ignorant people who, when consulted, will give verdicts according to their opinions whereby they will mislead others and go astray."
Full reference and source
Sahih al-Bukhari 7307 In-book : Book 96, Hadith 38 USC-MSA web (English) : Vol. 9, Book 92, Hadith 410 (deprecated)
View source on Sunnah.com (opens in a new tab)