It was narrated from Jabir that

The Messenger of Allah (ﷺ) said: “Ask Allah for beneficial knowledge and seek refuge with Allah from knowledge that is of no benefit.”

(Sunan Ibn Majah 3843)

For your benefit, the following QnAs answers were taken from https://www.soundvision.com/article/why-islamic-schools-some-questions-answers