A man named Onan spilled his seed “on the ground”, and the Lord “slew him also”:
Genesis 38:9-10 King James Version (KJV)
9 And Onan knew that the seed should not be his; and it came to pass, when he went in unto his brother’s wife, that he spilled it on the ground, lest that he should give seed to his brother.
10 And the thing which he did displeased the Lord: wherefore he slew him also.
Jesus said “Thou shalt not commit adultery” and “whosoever looketh on a woman to lust after her hath committed adultery with her already in his heart”:
Matthew 5:27-28 King James Version (KJV)
27 Ye have heard that it was said by them of old time, Thou shalt not commit adultery:
28 But I say unto you, That whosoever looketh on a woman to lust after her hath committed adultery with her already in his heart.
Jesus further adds “if thy right eye offend thee, pluck it out” and “if thy right hand offend thee, cut it off” and these statements would apply to any body part metaphorically speaking:
Matthew 5:29-30 King James Version (KJV)
29 And if thy right eye offend thee, pluck it out, and cast it from thee: for it is profitable for thee that one of thy members should perish, and not that thy whole body should be cast into hell.
30 And if thy right hand offend thee, cut it off, and cast it from thee: for it is profitable for thee that one of thy members should perish, and not that thy whole body should be cast into hell.
We are told to “abstain from fleshly lusts”:
1 Peter 2:11 King James Version (KJV)
11 Dearly beloved, I beseech you as strangers and pilgrims, abstain from fleshly lusts, which war against the soul;
Similarly we are also told to “make not provision for the flesh, to fulfil the lusts thereof”:
Romans 13:14 King James Version (KJV)
14 But put ye on the Lord Jesus Christ, and make not provision for the flesh, to fulfil the lusts thereof.