Both. I do believe that "communism will win" as an inevitability (with one big caveat, see below). Capitalism obviously is unsustainable and rife with internal contradictions that can only lead to its eventual demise. The obvious and broad example being that it requires infinite growth on a finite planet. But I think it can get very bad before it gets better, and expect it will further devolve into fascism (much more so than it already has) for most if not all of the western world, and the entire world will suffer as a result. Socialism, then communism will eventually emerge (since fascism is just as doomed by its contradictions as capitalism is), but before we get there, I expect there is going to be some truly unimaginably dark and horrible times on the way there. So in that sense, I am ultimately optimistic about the future of the world, but extremely pessimistic about its more immediate future.
But now for the caveat. I think that most people, even leftists, don't fully appreciate how much climate change is going to reshape the world. There is a real chance that it will get bad enough that civilization may not survive, that humanity as a species will be among the many that don't make it through the mass extinction we've only just entered. Even people fully on board with knowing climate change is bad and must be curtailed as much as possible as soon as possible still mostly don't realize how much a genuine existential threat it is on a planetary scale, on a scale of centuries and longer. It is by no means a certainty, but given the feedback loops we don't fully understand and definitely don't know how to interrupt, there is a possibility of Earth even going the way of Venus. Obviously I hope that's not the case, but it would be a mistake not to recognize the extreme potential of climate change. If we are able to mitigate it in time, I am like I said, ultimately optimistic. But I am beyond afraid that we won't be able to mitigate it in time.
In other words, it's not just "socialism or barbarism," it's socialism or annihilation.
Earth becoming more like Venus is an inevitability in the high hundreds of millions of years (and for scale, multicellular life has been around for roughly 5-600M years, with the more than 3 billion before that just being simple single-celled prokaryotic life), but that is completely independent of anthropogenic climate change, it is because of the expansion of the sun towards it's red giant phase. In terms of being habitable to life, Earth is easily past the half-way mark already, no matter what. However, that is far enough out that it doesn't bear worrying about and isn't something we can have any sort of impact on.