Can a mere thought break a commandment? If so, and given that we can't help our thoughts, the Sages would have given us advice on how to fight them. I could not find any such advice. Here is what I found:
The Talmud says: Sinful thoughts are harder than sin (Hirhurei ‘averah kashu me’averah). [Yoma 29a] Rashi explains: Ridding yourself of bad thoughts is more difficult than stopping yourself from committing bad actions. But Rambam sees it differently: We sin because of our animal side; but we think with what makes us greater than animals: Our mind. So a sinful thought is a worse offense than the sin itself. [Guide for the Perplexed 3:8]
The Talmud adds: When bad intention is followed by action, God combines it with the action and punishes both. When bad intention is not followed by action, God does not combine it with the action and there is therefore no punishment. [Kiddushin 40a]
The Talmud also says: Rabbi Yehuda HaNasi said that a man should not have intercourse with one woman while thinking about another woman. Ravina said: This statement is necessary only if both women are his wives. [Nedarim 20b]
On Yom Kippur, we say we are sorry we had bad thoughts: "Al chet shechatanu lefanecha b'harhor ha-lev -- [We ask God’s forgiveness] for the sin that we have committed by sinful thoughts."
But none of this says clearly that bad thoughts break commandments. Any other insights in the Sources?