The image of 'killing' the yetzer hara comes most directly from the Gemara's account of the end of days, where the Holy One slaughters the evil inclination before the righteous, and the sages dispute whether the eulogy recited at that moment is for Mashiach ben Yosef or for the yetzer hara itself, since even the righteous who struggled against it their whole lives now weep to see how they could ever have overcome so powerful a force (Sukkah 52a:2-4).
That same struggle is described elsewhere not as a single death-blow but as a daily battle: the evil inclination renews itself and seeks to kill a person every day, and only Divine assistance allows a person to prevail against it (Sukkah 52b:1-2, Chiddushei Aggadot, Kiddushin 82). The recommended weapon in that daily battle is dragging the inclination to the study hall, where, like stone dissolved by water or iron shattered by fire, it can be worn down or broken (Sukkah 52b:1-2).
Chazal frame Torah itself as the antidote God provided for the evil inclination He created, so that one who occupies himself with Torah is not handed over to it, while one who neglects Torah falls under its power (Kiddushin 30b:4-5), a teaching echoed and built upon by Mesillat Yesharim 5:7-9, who states that Torah study is the only remedy for this affliction and that there is no other way to be saved from it.
Berakhot 5a sharpens the method into stages: a person should incite his good inclination against the evil one, and if that does not succeed he should turn to Torah study, and if that too fails, recite the Shema, and if still unsuccessful, recall the day of death (Berakhot 5a:2). The kabbalistic tradition cited in Kaf HaChaim (Palagi), Petichat HaSefer 7, Kaf HaChaim (Palagi), Petichat HaSefer 5, and Kaf HaChaim (Palagi) 3:14 reads the maxim 'if one comes to kill you, rise early to kill him first' as referring specifically to the yetzer hara, meaning that rising early to engage in Torah study and Shema is the means by which a person actually kills it, since Torah carries the 'sword' power described in these sources to accomplish this.
Rabbi Alexandri's prayer and the awareness that one's own will is thwarted by the yeast in the dough — the evil inclination within every person — alongside the subjugation to foreign kingdoms, casts the matter as something requiring Divine deliverance rather than human conquest alone (Berakhot 17a:2).
The Tanya's Likkutei Amarim material develops two distinct modes of dealing with the yetzer hara: the service of the beinoni is to subdue the impulse and the thought rising from the heart to the brain, thrusting it away with both hands without engaging it (Tanya, Part I; Likkutei Amarim 27:3-4); this subduing requires alacrity born of joy rather than the heaviness that comes from sadness, since laziness guarantees defeat even to the physically stronger party (Tanya, Part I; Likkutei Amarim 26:1); a person can also actively degrade and humble the sitra achara by breaking his own heart and making himself despised in his own eyes, invoking the teaching that one should incite the good inclination against the evil one (Tanya, Part I; Likkutei Amarim 29:18-19); and ultimately, through performance of the practical commandments, the very vitality of the animal soul rooted in kelipat nogah is transformed from evil to good and absorbed into holiness itself, rather than merely suppressed (Tanya, Part I; Likkutei Amarim 35:9-11).
Peri Tzadik frames the struggle against the yetzer hara in two distinct modes, itkafya (forceful suppression, where one conquers and separates from the inclination) and ithafcha (a higher mode in which the evil itself is transformed and absorbed into holiness), illustrated through the rectification of eating (Peri Tzadik, Erev Yom Kippur 4:2); elsewhere Peri Tzadik stresses that Torah alone is insufficient without Divine help, since the yetzer hara constantly incites itself beyond what was implanted at creation (Peri Tzadik, Vayetzei 2:2), that the Levite's devotion to Torah and service enables conquest of the kelipah of desire (Peri Tzadik, Beha'alotcha 11:3), and that a daily 'redemption' from the yetzer hara is needed because it renews its assault every day (Peri Tzadik, Rosh Chodesh Tammuz 3:2).
Other sources describe this ongoing contest in terms of struggle, discipline, and vigilance rather than literal killing: Rambam speaks of habituating oneself repeatedly in the middle dispositions until they become fixed and effortless (Mishneh Torah, Human Dispositions 1:7); Tehillim counsels turning from evil and doing good (Tehillim 37:27); Sefer Chasidim frames the yetzer hara as ultimately beneficial, since subduing it in the face of temptation earns a person reward (Sefer Chasidim 155); Even Sheleimah describes multiple methods of subduing the external and internal evil inclination, including solitude, remembering the day of death, and self-affliction (Even Sheleimah 4:19); Orchot Tzadikim describes how the yetzer hara wages renewed war even against the humble, dressing itself in flattering rationalizations (Orchot Tzadikim 1:29); Kad HaKemach treats subduing the inclination as the essence of Torah, even overriding other mitzvot such as assisting one's enemy to unload his animal (Kad HaKemach, Submission 1:4); Pesachim's praise of the cobblers of Eretz Yisrael who would not raise their eyes to the prostitutes they served illustrates a lived case of quiet mastery over temptation (Pesachim 113b:1-2); and Malbim reads the order of the tefillin passages as reflecting that subjugating desire and conquering the inner enemy must precede higher contemplation (Malbim on Shemot 13:9).
Hasidic and kabbalistic sources extend the theme further: Shem MiShmuel describes the work of guarding as the ongoing suppression and subjugation of the evil forces within a person in order to rectify the Tree of Knowledge (Shem MiShmuel, Vayetzei 10:5); Bat Ayin stresses that a person must achieve freedom from physical desires and rule over his own nature before he can draw holiness into lower levels (Bat Ayin, Vayeshev 1); Nefesh HaChayim, Gate III teaches that fixing one's heart on God's exclusive sovereignty nullifies all other wills and powers that might otherwise act on a person, including presumably the yetzer hara (Nefesh HaChayim, Gate III 12:8-10); Nefesh HaChayim, Gate I distinguishes the state before Adam's sin, when the forces of evil stood entirely outside the person, from the present state in which the yetzer is internal to a person and disguises itself as the person's own self (Nefesh HaChayim, Gate I 6:7-8); and Alshich compares the war against the yetzer to the hardest kind of war, a young soldier battling an old and experienced king entrenched in a fortified city (Alshich).
Additional sources round out this picture of struggle rather than literal annihilation: Valle on Bereishis describes the evil inclination as a thoroughly reprehensible trait, contrasted with the fully rectified righteous person who possesses only good traits (Valle on Bereishis 37:20); Chiddushei Aggadot on Kiddushin teaches that the yetzer hara has no independent existence of its own, being rather a lack of existence whose entire activity is directed at the person (Chiddushei Aggadot, Kiddushin 30); and Tzofnat Paneach links redemption from the yetzer hara to the Shemot narrative, where Israel's firstborn were redeemed through the death of Egypt's firstborn (Tzofnat Paneach, Terumah 7:157).
Rav Eliezer Melamed situates this struggle within practical contemporary avodah: Yom Kippur is described as a day on which the body is restored to the soul precisely through freedom from enslavement to evil urges, paralleling the liberation of the Jubilee (Rav Eliezer Melamed (Peninei Halakhah, Days of Awe 6:11)), and elsewhere he teaches that both inclinations share one root and that free will allows a person to direct even powerful urges, such as the craving for food, toward either good or harm (Rav Eliezer Melamed (Peninei Halakhah, Simchat Habayit U'Virkhato 3:2)).
Among the modern poskim on the sheet, Tzitz Eliezer (20:22) addresses purifying the soul from corrupt thoughts and evil beliefs through resolving to abandon such counsel and immersing the soul in the waters of knowledge, while a separate responsum of the same author describes strengthening commitment to Torah and its mitzvot by breaking and subduing the evil inclination and empowering the good inclination, including through compelled consent (Tzitz Eliezer 4:10).