This world has been likened to a house prepared and beautified by a host for his guests. When they enter, he places in front of them a tray filled with flowers, fragrances and perfumes. It is obvious that the object of the host is that his guests must smell the beautiful fragrances, and then pass it to the next people so that they could also benefit. His desire is not that one guest must now take possession of them. If a person is unaware of the etiquettes of the gathering, and takes the plate to be his, placing it under his arm and going away, then all the people in the gathering will laugh at his foolishness, and mock him. Eventually, the owner will forcefully snatch the tray away from him and place it before another. You can well imagine the sorrow of this person.
In a like manner, this world is a guest house of Almighty Allah for those travelling to the Hereafter, not for residing here forever. Almighty Allah wants the travellers to the Hereafter to benefit according to necessity, just as one derives benefit from a loaned item, and fulfills his need. Thereafter, he happily hands it over to the next person, and reaches his destination. Keeping the heart attached to loaned things will lead you to be extremely sad, and embarrassed at the time of departure from this world.
From Al-Arbain fi Usulid Din by Imam Muhammad Al Ghazali (Rahimahullah)