Sefer Ha’mitzvos Ha’Katzar (The concise book of mitzvos) By the Chofetz Chaim
This book lists the Torah mitzvos that can be observed today
Second Section – the Negative Commandments
156. It is a negative commandment “do not follow after the thoughts of the heart or what the eyes see”
As it states in Bamidbar (Numbers) 15:39, “do not go after your heart or your eyes.” This means do not let one’s heart have thoughts that cause a person to uproot one’s faith, because Satan will turn him to heresy, Heaven forbid. Do not go after what the eyes see – this means immorality. So states our Sages in Gemara Brachos 12b – “after your heart” means heresy; “after your eyes” means immorality.
Included in this commandment is that one is not allowed to think and chase after other cravings and desires in this world. A person needs to be very, very careful in regards to unacceptable thoughts because everything depends on this. A person needs to sanctify and purify his thoughts with all of his strength. If a certain desire comes upon him, he should intend to have the strength to stand in the palace of the King, the Ruler of the World, blessed is He, and that his body does not weaken in the service of the Creator.
A person who transgresses this commandment and has an unacceptable thought of heresy, Heaven forbid, or thoughts of immorality, or to chase after the desires of this world, he has done a serious sin that removes him from the World to Come and makes impure his 248 limbs and his 365 sinews, both physical and spiritual ones. Therefore, a person should be very careful with this.
This applies in all places and at all times, for men and for women.