I find writing can be helpful for clarifying my thoughts and reaching insights about things, things perhaps I wouldn't have seen by trying to think through or verbalise out loud.
Sometimes though I find it helpful talking out loud to myself. Giving myself a pep talk in preparation for upcoming challenges I see coming over the horizon, those dragons heading my way about to test me. There's no escape from those unfortunately, such is the kamma of having a body, of existence itself, an existence that is interdependent. It is simply the nature of an ever-changing universe in a state of entropy.
Anyway, talking oneself out of a negative state of mind is the Buddha's fourth strategy for abandoning unwholesome states of mind.
The five strategies recommended by the Buddha for abandoning negative mental states are:
1. Replacement, replace the negative state with its opposite, e.g. sense-desire with contentment or equanimity, ill-will with serenity and goodwill, and so on...
If that doesn't work move to step two.
2. Concern for the opinion of the wise. Imagine what someone noble and wise would advise if they saw you in that state of mind; or imagine that you are about to go out to dinner with people you really respect and admire and want to abandon that state of mind post haste as you want to make a good impression and not ruin the evening or feel regret later.
If that fails move on to step three.
3. Distract yourself from the mood until it either goes away on its own and is replaced by calm and peace, or until it becomes weak enough to apply one of the strategies in the steps above.
If this fails move to step four.
4. Talk yourself out of it. Try to be gentle, kind, and encouraging if you can. But if you need to be fierce with yourself, be so in a loving way, without feeling emnity towards yourself, treat yourself with compassion, like you would treat a noble friend you were correcting.
If this doesn't work, then the next step is considered a last resort, it goes against what is advised in popular psychology, but must be applied nevertheless, as one simply cannot allow that negativity to continue, to do so will cause harm both to oneself and others.
5. Suppress the mood, do not allow it to express itself. The Buddha describes it as: 'When a stronger man pins down a weaker man.' One must hold that mood down and not allow it to dominate the mind or express itself in any way. One must do this until it is sufficiently weak enough to then apply one of the strategies above to safely remove it.
I ten to use the fourth strategy a lot. I will often use that strategy as a tool to weaken the mood sufficiently so that earlier strategies become more effective. For example I will talk myself into using distraction (third strategy).
With the third strategy it is good to have some activity you like doing that you can distract yourself with, so your attention is not focused so much on the negative mood, and absorbed instead by something else. Preferably the distraction is a wholesome activity. Our intentions and everything we do leave ripples and traces in the mind, when we do something once, we increase the likelihood we will do it again at some point, and then again and again, and the traces and ripples grow larger, leaving deeper and deeper grooves in the mind, which in time become new habits.
What we focus on grows stronger, so don't feed the monsters in your head, starve them of attention. What goes on in the mind is a lot to do with what we pay attention to. What we continually pay attention to dominates our conscious awareness, and the unconscious mind (trying to be helpful) will generate more of the same, actively filtering out things from awareness it considers unimportant and bringing us more of the same, reinforcing it. Not too disimilar to how the algorithm on YouTube works I guess, only more complex.The narrator part of mind puts this all together into a story. Which become the stories we tell ourselves about reality, about others, about ourselves. These in turn become our opinions, our delusions. Delusions come from a lack of information (not seeing the whole picture), misinformation and disinformation. Ignorance basically.
The first of the right efforts: prevention, is all about where one places their attention. One trains the mind to let go of unwise attention to the fault in ourselves, the world and others; and to let go of unwise attention to the attractive in ourselves, the world and others. What we pay attention to grows stronger. Unwholesome behaviours grow stronger in the mind, they take root and become harder to shake, so you want to become addicted to the wholesome if you can. Your future self will thank you for it.
The Buddha says with patience and perseverance one will eventually become super fast at removing negative states of mind. He likens consciousness in this instance to being like a red hot frying pan, with unwholesome states of mind like water droplets that upon landing on the pan go psssst and evaporate out of existence, leaving no trace. That's how quick one wants to aspire to be at removing unwholesome states of mind.