The most critical way to improve your mental outlook and sense of purpose is to believe in something larger than yourself. Search for something (a cause, a purpose, a religion, etc.) that moves you. You must believe in this intrinsic merits of this cause in themselves; if you pursue it simply for your own benefit, you will be disappointed. Find something you believe in and immerse yourself in it.