Perfect verse for this situation:
"How can a young person keep His way pure: by living according to the Word."
Paul goes a bit deeper into this cleansing through the Word:
"Husbands, love your wives, just as Christ loved the church and gave himself up for her to make her holy, cleansing her by the washing with water through the word, and to present her to himself as a radiant church, without stain or wrinkle or any other blemish, but holy and blameless. "
Also, we’re called to be transformed by the renewing of our mind. This all happens with the Bible as our catalyst.
Read the Bible.
Read large portions. Whole books at a time if you can.
Study the context and read it like you would a story.
Meditate on it. Read as deeply as you can into the intention behind the words.
Apply as much as you can to your own life.
The Word of God is perfect and living and active. It’s like planting seeds in your soul. God can take something you’ve read weeks ago or years ago and bring it to mind at the right time. He can use it to change your speech and thought patterns. You’ll find that you’re thinking and talking and imagining more and more purely and righteously.