One problem with negative thinking is one's loyalty towards it: if I am thinking negative thoughts, I am inclined to believe them because I am thinking them. That's called arrogance: belief in my own superior abilities (in this case, thinking abilities), despite contrary evidence. The solution is to withdraw my loyalty towards my own negative thinking.
Instead of seeing my negative thinking as mine, the answer is to see it as the narrative of a small, excessively unattractive, puny, and nasty little goblin, crouching in the corner of my mind, possibly wearing (given the season) a tatty Christmas hat. It is ridiculous and unreal.
Thus: the negative thinking is not mine: it is a squatting, extraneous, and ill-intentioned set of ideas within my mind. It is not part of me; and it does not represent the truth.
Once I've disowned it, the job is to replace the narratives.
Repeat the following prayer whenever the negative narrative starts up, and imagine the ideas, powered by ranks of angels and God himself, blasting out, as if trumpeted from the top of a castle or citadel, and banishing the unwelcome, alien negative thoughts, like shadows, into nothingness.
'God is fully present here with me, now. God is the only real Presence; all the rest is but a shadow. God is perfect Goodness, and God is the cause only of perfect Good. I am divine spirit. I am a child of God. In God I live and move and have my being, so I do not fear. I am surrounded by the Presence of God and all is well. I am not afraid of the past; I am not afraid of the present; I am not afraid of the future; for God is with me. The Eternal God is my dwelling place and underneath are the everlasting arms. Nothing can touch me but the direct action of God Himself, and God is Love.'
Repeat as often as necessary, namely whenever tempted to think negatively. If you're meditating on negative things, you're meditating anyway, so you might as well meditate on something positive and affirming.