It's quite likely that you have significant issues you haven't addressed yet. Getting into good medical care, therapy, exercise, and supportive e.g. nutrition, etc is likely more important than virtually anything else you'll do in your life, with a reasonable exception for choosing the right person to spend your life with and having a family. But having a good social life is a hell of a lot easier if you're in great physical and mental shape. I took all of those things very seriously, and I probably did not put enough value into any of those things, even given that orientation.
That leads right into: The only thing you can truly exert control over is yourself, and it's quite likely that nearly all of your problems are the result of your choices, either indirectly through the environment you live in or directly through the actions you take. Humility is drastically underrated, and being healthy plays into this enormously as well.
That being said, I'd love to hear a perspective from some of the older HN folks - what am I missing as a mid-40s person that I should absolutely be paying attention to?