[We] say: It is binding upon the student of [Islāmic] knowledge to be ever looking out to correct [his] intention and make it sincere for Allāh the All-High.
And someone may say: “Does this mean that I do not seek [Islāmic] knowledge until I correct my intention?!”
I say: No, seek [Islāmic] knowledge and during your seeking, keep checking on yourself and work on fixing yourself in this issue of having correct intentions.
Then if he were to say: “I want to leave seeking knowledge until I correct my intention.”
I say: This is a satanic ploy. He has opened up a door for you from the doors to goodness while he wants to turn you away from that which is better and more deserving [of your efforts]; because of that, continue seeking knowledge and work on fixing yourself, since your knowledge will certainly show you the right way, if Allāh wills, to making the intention sincere for Allāh the All-High.
And the Salaf1 used to say:
We used to seek knowledge for other than Allāh; then [knowledge] refused that [it] be for other than Allāh.