The Prophet ﷺ used to say, "Allah, I seek refuge in You from knowledge that brings no benefit, from a heart that does not feel awe, from a soul that is never satisfied, and from a supplication that goes unanswered."
أن النبي ﷺ كان يقول: اللهم إني أعوذ بك من علم لا ينفع، ومن قلب لا يخشع، ومن نفس لا تشبع، ومن دعوة لا يستجاب لها.
Muslim narrated it in the Book of Remembrance and Supplication (2722) from the hadith of Abu Muawiya, from Asim, from Abdullah bin Harith, and from Abu Uthman Nahdi, from Zayd bin Arqam, and he mentioned it as part of a longer hadith, which will come in its proper place.