I spend a lot of time thinking about the future - not just the immediate future or the "next 20 years" future, but the long-term future of humanity. And it seems there are two really big questions determining what will happen.
The first is, "Can we sustain an industrial-level society indefinitely?" Using fossil fuels, the answer is obviously no, because there's a finite supply in the Earth and it's dwindling fast. We can switch to nuclear, but eventually the uranium will run out too. Renewables tend to only be viable in specific geographical regions, and aren't always reliable even there. So the real question ends up being, "Can we develop some form of cold fusion and/or an economically efficient method of harvesting resources from space?", and that's a scientific question that we don't have an answer for yet. But if the answer is "no, it's physically impossible," then we're inevitably going to revert to a pre-industrial society at some point down the line. It's an incredibly bleak and depressing prospect, but that's no reason to rule it out.
But assuming the answer is yes, the second question becomes "Is it possible for technology to develop to the point that we could build a fully-automated post-scarcity society?" Again, that depends on what the physical limitations of technology are, and we simply don't know yet. If the answer is no, then the future is going to look a lot like the present for centuries and millennia to come. We can expect a long series of boom-bust cycles, sporadic periods of decline marked by economic depressions and international wars and civil conflicts, and experimentation with lots of different political and economic systems. Still, the vast majority of people will be able to live fairly well, at least to the extent that modern people in developed nations today live fairly well.
On the other hand, if the answer to both questions is "yes," then we can have the utopian Star Trek future of our dreams, where everyone can have anything they want (materially speaking, at least), and we all have plenty of leisure time to devote to science or art or writing or sports or exploration or entertainment or social interaction. It's a great outcome to hope for and even to strive for, but we have no guarantee that it's even possible, let alone that it will happen.
(There's a fourth option, of course, which is "a big rock hits the planet and kills literally everyone." Or, alternatively, "we accidentally create a deadly virus/nanotech swarm/artificial intelligence that goes rogue and kills literally everyone." Or, as a slightly less fatalistic variant, "we blast ourselves back to the Stone Age with nukes, killing almost literally everyone and leaving the survivors to start over from scratch." But these scenarios all seem extraordinarily unlikely to me.)