On the authority of Jaabir ibn Abdullah (RA). he said The Messenger of Allah (ﷺ) said, “Ask Allah for beneficial knowledge and seek refuge from that type of knowledge which is not beneficial.
Source: Hasan (Albani). Ibn Majah: 3843
Duas from IslamicAPI's Masnun Dua dataset (based on the Quran, hadith, Hisnul Muslim and Rahe Belayat). See the dataset