Totally possible and it's a choice. I spent much of my younger years in a precipitous downward spiral, I was a severe pessimist. After a series of devastating events I caused, I made a choice; die or find something to live for, in the world or within myself.
I'm now a, probably overconfident, optimist and life is good. You slip back sometimes, but I just actively refuse to think about negative thoughts.