Catholicism

Introduction to the Devout Life, Chapter x (96)

How to fortify your heart against temptations.
Consider from time to time which passions most prevail in your soul; and, having discovered them, adopt a manner of life wholly opposed to them, in thoughts, words, and deeds. For example, if you feel yourself inclined to the passion of vanity, consider from time to time the miseries of human life, how grievous these vanities will be to the conscience on the day of death, how unworthy they are of a generous heart, that they are nothing but trifles, children’s amusements, and the like. Speak often against vanity; and although it may seem to you to be against your heart, do not fail to despise it greatly; for by this means you will commit yourself, even in reputation, to the contrary party; and by speaking ill of something, we stir ourselves to hate it, although at first we were attached to it. Perform works of abasement and humility as much as you can, even though it may seem to you to be with reluctance; for by this means you accustom yourself to humility, and weaken vanity, so that when temptation comes, your inclination will no longer be able to favour it so much, and you will have greater strength to resist it.
If you are inclined to avarice, think often of the folly of this sin, which makes us slaves to that which was created only to serve us; consider that at death we must leave everything, and that our possessions will then pass into the hands of someone who will squander them, or to whom they will serve for ruin and damnation, and other such thoughts. Speak strongly against avarice, greatly praise contempt of the world, strive often to give alms, and to neglect certain opportunities of amassing wealth.
If you have a leaning to inspire or receive love, often consider how dangerous this diversion is, both for yourself and for others; how unhappy a thing it is thus to dissipate the noblest part of our soul; how it exposes you to the reputation of being vain and light-minded. Often speak in praise of simplicity and purity of heart, and do as many acts of these virtues as you possibly can, avoiding every kind of affectation and refinement.
In short, in time of peace, that is to say, when the temptations of the sin to which you are subject do not press you, perform many acts of the contrary virtue; and if the occasions do not come to you, go out to meet them; for by this means you will strengthen your heart against future temptations.

Source François de Sales, Introduction à la vie dévote (1609), Project Gutenberg #53540 — I Choose Peace translation from the French · Contents