It was from the duaa of Rauslullah (Salla Allahu alayhi wa sallam) to say:
"Oh Allah, I ask you to increase me in useful knowledge and I seek refuge in you from knowledge that is not useful."
Useful knowledge is that which:
makes you grow in the fear of Allah
increases you in awareness of your defects
deepens your knowledge of the worship of your Lord Most High
decreases your desire for this world
increases your desire for the life to come
an opens your eyes to the defects of your actions so that you guard against them
Abu Musa (May Allah be pleased with him) reported: The Messenger of Allah (salla Allahu alayhi wa sallam) said,
"The guidance and knowledge with which Allah has sent me are like abundant rain which fell on a land.
A fertile part of it absorbed the water and brought forth profuse herbage and pasture;
and solid ground patches which retained the water by which Allah has benefited people, who drank from it, irrigated their crops and sowed their seeds;
and another sandy plane which could neither retain the water nor produce herbage. Such is the similitude of the person who becomes well-versed in the religion of Allah and receives benefit from the Message entrusted to me by Allah, so he himself has learned and taught it to others; such is also the similitude of the person who has stubbornly and ignorantly rejected Allah's Guidance with which I have been sent.'
[Al-Bukhari and Muslim]
Mu`awiyah (May Allah be pleased with him) reported: The Messenger of Allah (S) said, "When Allah wishes good for someone, He bestows upon him the understanding of Deen.'
[Al-Bukhari and Muslim].