I find comfort in that I am not alone, thinking of all the peasants and regular workers across history who didn't amount to much either, but still mostly fought on and had a good life. Plenty of examples in immediate family as well.
And lastly, I found that there is one thing that one can do that is absolutely unique that nobody can match anywhere in the world, and that is - as corny as this sounds - kids. It may be a touchy subject or not for everybody. But raising a human with the best possible effort you can muster is an accomplishment at least one person will remember and value 100000x more vs. any world champion in solving IOI problems or writing clever functional code :-)