This passage by Nietzsche is pretty mind blowing and showcases his formidable talent as a psychologist, not just as a philosopher. What is pretty amazing about his insights is that you can see the seeds of several psychological disciplines, including psychoanalytic, behavioral, and of course existential. Without further ado:
Self-Control And Moderation, And Their Final Motive.- I find not more than six essentially different methods for combating the vehemence of an impulse. First of all, we may avoid the occasion for satisfying the impulse, weakening and mortifying it by refraining from satisfying it for long and ever-lengthening periods. Secondly, we may impose a severe and regular order upon ourselves in regard to the satisfying of our appetites. By thus regulating the impulse and limiting its ebb and flow to fixed periods, we may obtain intervals in which it ceases to disturb us; and by beginning in this way we may perhaps be able to pass on to the first method. In the third place, we may deliberately give ourselves over to an unrestrained and unbounded gratification of the impulse in order that we may become disgusted with it, and to obtain by means of this very disgust a command over the impulse: provided, of course, that we do not imitate the rider who rides his horse to death and breaks his own neck in doing so. For this, unhappily, is generally the outcome of the application of this third method.
In the fourth place, there is an intellectual trick, which consists in associating the idea of gratification so firmly with some painful thought, that after a little practice the thought of gratification is itself immediately felt as a very painful one. (For example, when the Christian accustoms himself to think of the presence and scorn of the devil in the course of sensual enjoyment, or everlasting punishment in hell for revenge by murder; or even merely of the contempt which he will meet with from those of his fellow-men whom he most respects, if he steals a sum of money, or if a man has often checked an intense desire for suicide by thinking of the grief and self-reproaches of his relations and friends, and has thus succeeded in balancing himself upon the edge of life: for, after some practice, these ideas follow one another in his mind like cause and effect.) Among instances of this kind may be mentioned the cases of Lord Byron and Napoleon, in whom the pride of man revolted and took offence at the preponderance of one particular passion over the collective attitude and over reason. From this arises the habit and joy of tyrannising over the craving and making it, as it were, gnash its teeth. “I will not be a slave of any appetite,” wrote Byron in his diary. In the fifth place, we may bring about a dislocation of our powers by imposing upon ourselves a particularly difficult and fatiguing task, or by deliberately submitting to some new charm and pleasure in order thus to turn our thoughts and physical powers into other channels. It comes to the same thing if we temporarily favour another impulse by affording it numerous opportunities of gratification, and thus rendering it the squanderer of the power which would otherwise be commandeered, so to speak, by the tyrannical impulse. A few, perhaps, will be able to restrain the particular passion which aspires to domination by granting their other known passions a temporary encouragement and license in order that they may devour the food which the tyrant wishes for himself alone.
In the sixth and last place, the man who can stand it, and thinks it reasonable to weaken and subdue his entire physical and psychical organisation, likewise, of course, attains the goal of weakening a single violent instinct; as, for example, those who starve their sensuality and at the same time their vigour, and often destroy their reason into the bargain, such as the ascetics.- Hence, shunning the opportunities, regulating the impulse, bringing about satiety and disgust in the impulse, associating a painful idea (such as that of discredit, disgust, or offended pride), then the dislocation of one’s forces, and finally general debility and exhaustion: these are the six methods. But the will to combat the violence of a craving is beyond our power, equally with the method we adopt and the success we may have in applying it. In all this process our intellect is rather merely the blind instrument of another rival craving, whether it be the impulse to repose, or the fear of disgrace and other evil consequences, or love. While “we” thus imagine that we are complaining of another, i.e. the perception of the violent suffering which is being caused us presupposes that there is another equally or more violent impulse, and that a struggle is impending in which our intellect must take part.
(Frederick Nietzsche, The Dawn of Day, Kindle Version Pos. 1344-1377)