Zaid ibn Thabit reported: I heard the Messenger of Allah, peace and blessings be upon him, say, “Whoever makes the world his more important matter, Allah will confound his affairs and make poverty appear before his eyes and he will not get anything from the world except what has been decreed for him. Whoever makes the Hereafter his most important matter, Allah will settle his affairs and make him content in his heart and the world will come to him although he does not want it.”
Source: Sunan Ibn Majah 4105