I think advances in scientific understanding may have unfortunately been detrimental to mental wellbeing at scale. Knowing that there is no higher power or grand purpose, knowing that our civilization is probably cooked in the near term, and knowing that even if our civilization isn't immediately cooked, Earth and eventually the universe is, are all not greatly emotionally satisfying.
It probably doesn't help that every scientific advance gets co-opted to make the rich richer and civilization worse.
I guess the world oscillates between good times and bad times. Those who are born in bad times get to see the world improve drastically and helping that along is a purpose. Those who are unlucky enough to be born in good times get to see everything crumble. At best they can inspire the rebuilding just before dying of old age.
We shouldn't be so sure about the fate of the universe. If you were born after 1980 you probably feel more certain about the eventual fate of the universe than people born in 1940. A lot of scientific advances that enabled us to even predict the universe isn't steady-state are less than 100 years old. They may change, and our predictions accordingly, in the next 100 years. In fact they did change several times. There was the steady state, then the big crunch, then the big rip, then the heat death. We can't be sure about heat death either - dark energy adds more energy into an expanding universe, which may be exploitable forever.
What happens when you have kids? You leave something that will last after your death. Then you make sure that they are properly raised and have enough resources, so that your "mark on the world" is more appreciated by other people. Ultimately all the "good life" have one thing in common. Improving life of our species.