Comprehension and application

How can the teachings on lawful earnings and worldly attachment be understood together?

Earning, good deeds, and seeking knowledge (Hadith 44–50)