Psalm 24:3-4
Who may ascend onto the mountain of the Lord? And who may stand in His Holy place? He who has clean hands and a pure heart, who has not lifted up his soul to what is false, nor has sworn (oaths) deceitfully.
The more we keep our eyes fixed on the word of God, the easier it is to keep our hearts pure. It is true that when we look at something ungodly too long, it will become acceptable in our minds. God wants us to renew our minds as protection from what is false in this world so that we can keep the channel of communication open to God and not be hindered by sin.