Taqwa (تقوى taqwā / taqwá ) is an Islamic term for being conscious and cognizant of God, of truth, of the rational reality, "piety, fear of God". It is often found in the Quran. In spiritual terminology, piety is a virtue which may include religious devotion, spirituality, or a mixture of both. A common element in most conceptions of piety is humility.
This is a question which can have many answers. In addition to the other answers given, you could:
* Be sure to pray all your salat. Regular salat makes a person mindful of God and makes a person embarrassed to do things that would displease God.
* Try to minimize exposure to things that would be ethically harmful to you (in-person, television, or social media). Go on an "information diet" - that is, be conscious of how what you are taking in is affecting you, and as much as possible choose the media that you feel makes you a better person.
* Try to spend some time regularly in the company of believers, as it strengthens and refreshes the soul.
Gaining knowledge is key because it brings you closer to the Creator by making you more aware. We must also join this with seeking help of Allah through supplication asking Him to allow us to put the knowledge we learn into practice.