Islam calls us to learn all kinds of beneficial knowledge. Branches of knowledge vary in status, the highest of which is knowledge of Sharee’ah (Islamic Law), then other fields of knowledge, such as medicine, etc.
The Prophet made seeking knowledge an obligation upon every Muslim, and he explained that the superiority of the one who has knowledge over the one who merely worships is like the superiority of the moon over every other heavenly body.
He said that the scholars are the heirs of the Prophets and that the Prophets, may Allah exalt their mention did not leave behind any money, rather their inheritance was knowledge, so whoever acquires it has gained a great share.
اِقۡرَاۡ بِاسۡمِ رَبِّكَ الَّذِىۡ خَلَقَ
خَلَقَ الۡاِنۡسَانَ مِنۡ عَلَقٍۚ
اِقۡرَاۡ وَرَبُّكَ الۡاَكۡرَمُۙ
الَّذِىۡ عَلَّمَ بِالۡقَلَمِۙ
عَلَّمَ الۡاِنۡسَانَ مَا لَمۡ يَعۡلَمۡؕ
“Recite in the name of your Lord Who created,
created man from a clot of congealed blood.
Recite: and your Lord is Most Generous,
Who taught by the pen,
taught man what he did not know.”