How to not be pessimistic ?

I feel like even thought I am in nowhere near as horrible a spot as I was a before, the past few months to date are kind of just burned into my mind, and as a comment in another sub told me, it’s like “trying to put the toothpaste back in the tube.”

I can’t help but feel sad about this, like it’s fundamentally altered my brain you know? Almost as if regardless of how much I work to recover it will just always be burned into my mind. It’s just depressing. I can still see a happy future for myself, it’s what I look forward to every day, but now I’m like, can I even have that if everything that’s run through my mind has more or less wrecked my brain?

And then it leads back into the endless philosophical questions about choice, the self, identity, ego