The energy of youth seems impossible to separate from the optimism. I suspect you could find enormous stamina in older folks for a goal that can rekindle their optimism.
It's not enough to have personal optimism you need a community/culture of optimists.
~10 years ago that was there in a big way for tech. It was peak YC prestige. HBO's Silicon Valley brought the start-up struggles/drama into the mainstream. Most people who worked hard were rewarded. Large in-person tech meetups provided a venue to share your success story.
The tech industry now feels bloated, mundane, low-value/rent-seeking, or as a net-negative for society. It isn't fun to share your success since it comes off as boasting instead of inspiring.
How I miss 2014. I was productive, optimistic, and energetic in a way I can barely comprehend now.
But the industry hasn't really changed, just the window dressing did. Was SV peddling addictive user-as-product products then? Of course. Did most employees never really have a chance of getting rich? Yeah. Was the area boring suburbia with old dilapidated buildings? Yes, same as today.