Jesus warned us in Matthew 5 in the strongest language that if we look at a woman to lust for her we’re committing adultery with her in our hearts. So He said we need to do whatever we have to control our eyes and our “right hand” so our whole bodies will not be thrown into hell when we die.
“You have heard that it was said to those of old, ‘You shall not commit adultery’ [old covenant].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. And if your right hand [masturbation] causes you to sin, cut it off 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. (Mt. 5:27-31)