14 “You shall not commit adultery. Exodus 20:14
As Jesus broadened the previous commandment in Matthew 5:27-32, so He expanded this commandment.
Adultery starts in the heart.
A fair treatment of this verse can be found in Got Questions?:
The positive part of the command would entail doing the opposite of what the command prohibits: chastity in body, mind, words and action; keeping watch over what we take in with our eyes and the other senses; an attitude of temperance and self-control (i.e., moderation); being discerning over the company we keep; dressing modestly; and fulfilling our marriage vows in regards to sexual relations and cohabitation.
The bottom line is that God instituted this command for our protection. He already defined marriage as between a man and a woman in Genesis. Going outside those boundaries causes unnecessary heartaches and problems, and defiles the sanctity of marriage.
But it all starts with what you feed your mind and spirit with.