There’s a very good short story by Alastair Reynolds called Understanding Space and Time. The protagonist is the last human alive. He finds his purpose in understanding the universe. Even once he completes this goal, he must go on living his life.
It may sound trite, but I tell people to put themselves in that position. What would you spend your time doing if you were the last human alive? Now obviously you don’t do that verbatim, but I think it should be an influential datapoint on your choice of career path.
The best news is that if you’re a half decent technical mind with a half decent network, the odds of you ever starving are quite low (not including dependents. That’s a different story). As a result, you have ample opportunity to carve out whatever corner of the universe you want for yourself :)