Q. 108. What doth the seventh commandment teach us?
That all uncleanness is accursed of God: and that therefore we must with all our hearts detest the same, and live chastely and temperately, whether in holy wedlock, or in single life.
 Leviticus 18:27;  Deuteronomy 29:20–23;  1 Thessalonians 4:3–4;  Hebrews 13:4; 1 Corinthians 7:4–9.
Q. 109. Doth God forbid in this commandment, only adultery, and such like gross sins?
Since both our body and soul are temples of the Holy Ghost, He commands us to preserve them pure and holy: therefore He forbids all unchaste actions, gestures, words, thoughts, desires,  and whatever can entice men thereto.
 Ephesians 5:3; 1 Corinthians 6:18;  Matthew 5:28;  Ephesians 5:18; 1 Corinthians 15:33.
The Seventh Commandment is “Thou shalt not commit adultery.” But again, we must not think that the commandment only forbids the physical act of adultery involving at least one married person. As the Fifth Commandment has to do with relationships, and the Sixth Commandment has to do with life, so the Seventh Commandment has to do with chastity. As such, the Seventh Commandment forbids all forms of unchastity and impurity, whether in deeds, words or thoughts and desire; and “whatever can entice men thereto,” such as drunkenness, pornography or lewd dressing.
This broad understanding of the Seventh Commandment is especially important in our modern day society where even adultery proper is glamorised on television, and teenagers consider fornication to be a necessary part of growing up. Indeed, even some, who profess to be Christians, would try to wriggle their way out of guilt,—in much the same way as the ex-president of the United States,—by insisting that their behaviour does not directly contravene the Seventh Commandment.
But the Word of God is clear. The Lord Jesus says, “Whosoever looketh on a woman to lust after her hath committed adultery with her already in his heart” (Mt 5:28). That is to say, the Seventh Commandment does not only forbid the actual act of adultery or fornication. Even lust is forbidden, not to mention anything more than that.
Sadly, the violation of this commandment has brought much sorrow to otherwise godly Christians and even ministers of the Gospel. Yes, we must not think that all who have fallen into this sin are incorrigible and morally loose. Like king David, many an otherwise morally upright believer has been tempted and drawn almost irresistibly (Prov 7:21–22), in a moment of weakness, to do some things, which they would regret too late (Prov 7:23). There is, of course, forgiveness in Christ even for the worst sin for the repentant sinner. But no one ought to presume that he will receive forgiveness even as he engages in sin against God. And so, the believer ought rather to be forewarned. To be forewarned is to be forearmed! Let us therefore take serious heed to the Apostle Paul’s command to “Flee fornication” (1 Cor 6:18). Let us seek to avoid any situation that may give rise to temptation (remember that fornication and adultery amongst professing believers almost always arise out of innocuous situations—as those who have fallen will testify). Let us therefore seek to imitate Joseph, not only in his fleeing from Potiphar’s wife, but in his refusal to “be with her” (Gen 39:10)!
I believe young people, especially, should avoid being found in the same room alone with an unrelated member of the opposite gender except for the briefest moment. I always remember how Richard Baxter, when he catechised, on a one-to-one basis, the women members in the church, would make sure that another woman observes from the corner of the room. Such precautions should not be viewed as paranoiac, but prudent, seeing how the remnant of our sinful nature may rear its ugly head when it is least expected.
Heidelberg Catechism >