1. Looking with lust is mental adultery.
"You have heard that it was said to those of old, ‘You shall not commit adultery.' But I say to you that whoever looks at a woman to lust for her has already committed adultery with her in his heart. If your right eye causes you to sin, pluck it out and cast it from you; for it is more profitable for you that one of your members perish, than for your whole body to be cast into hell" (Matthew 5:27-29).
Jesus used hyperbole here to make a strong point: If the only way to avoid lust were to pluck out an eye, that would be better than eternal death. Thankfully that's not the only way!
2. Like all sins, the best way to avoid pornography is to avoid the source. Block such sites on your computer, etc.
"Flee sexual immorality. Every sin that a man does is outside the body, but he who commits sexual immorality sins against his own body" (1 Corinthians 6:18).
3. God's Spirit can give us help to avoid giving in to lust.
"I say then: Walk in the Spirit, and you shall not fulfill the lust of the flesh" (Galatians 5:16).