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."
Sahih al-Bukhari Book 96, Hadith 38