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.