The Sages taught: I created the evil inclination and I created Torah as its remedy. If you engage in Torah you will not be delivered into its hand, as it is said “If you do well, there is uplift”; if you do not, “sin crouches at the door.” Moreover, all its dealings are with you, as it is said “and its desire is toward you”; and if you wish, you can rule over it, as it is said “and you shall rule over it.”
On the daf / in context: The verse is read as a direct lesson about Torah as the antidote to the yetzer hara and about a person’s power to overcome it.
Method — The baraisa presents Torah as the remedy God created for the evil inclination. The reasoning is conceptual: the yetzer hara is a powerful inner force, but Torah study supplies the means to resist it and avoid being delivered into its control.
Textual trigger — Genesis 4:7, “אִם תֵּיטִיב שְׂאֵת ... וְאַתָּה תִּמְשָׁל בּוֹ.” Kiddushin 30b explains the verse through “בָּרָאתִי יֵצֶר הָרָע וּבָרָאתִי לוֹ תּוֹרָה תַּבְלִין” (“I created the evil inclination and created Torah as its antidote”).
What Is Learned: Torah study protects a person from the yetzer hara, and a person can ultimately rule over it.