Outward behavior reinforces the inward state. If you want your inward state to be purer and more righteous, then conform your outward behavior to the ideal that you desire to be in your heart. Feed the wolf, as they say, which you desire to be victorious.
Our flesh naturally inclines to entropy, so wicked behavior is easily amplified and overtakes a well-meaning heart. Righteousness leads to greater sanctification (being set apart from the world), but it is a more difficult task. God’s Spirit, prayer, righteous company, and studying the Scriptures will all help you, but even these things require concerted effort. Forward motion takes work, while backwards motion takes no effort at all. Merely stand still, and your morals will begin to fail you.
Romans 6:19