The Talmud in Kidushin 30b states that Torah study is essential activity for gaining control of the evil inclination.
"... so too the Holy One blessed be He said: 'I have created the evil inclination and I have created the Torah as its tavlin (spice). If you toil in the Torah, you will not be delivered in his hand. but if you do not, you will be delivered in his hand."
Similarly, the Mesilas Yesharim (ch.5) says:
For the Creator, blessed be He, who created the evil inclination also created the torah as its antidote as our sages of blessed memory have stated: "I have created the evil inclination, and I have created the torah as its antidote" (Kidushin 30b). Behold, it is obvious that if the Creator created for this affliction only this remedy, then it is impossible under any circumstances for a man to heal himself from this affliction without employing this treatment. One who thinks to save himself without Torah study is only mistaken, and will see his error only in the end, when he dies in sin.
How does this work? Is it due to aligning a person's mind with the torah way of thinking (i.e. the truth), or perhaps by reporting to him the reward and punishment incurred by others, or perhaps some other reason.