Standard dose sertraline has a cognitive effect in non-depressed people, as besides being a serotonin reuptake inhibitor, it also has a slight dopaminergic effect (irrelevant for therapeutic purposes it seems, but still noted in case reports) I've had friends that don't use stimulant medication, reporting positive effects in both mood and cognition with a short low dose trial (25mg/d)
If you go down this path, use your newfound perspective and mood (as you'll probably feel different) to learn more about your personality and work on improving it, so that you are able to deal better with life, and find out in what things your usual self falls short when dealing with others. The comment from austin-cheney seems very good addressing a similar thing.
About diet, check out this talk from Georgia Ede called 'Nutritional and Metabolic Strategies for Optimizing Mental Health':
https://www.youtube.com/watch?v=UkqZW_sBPTg
Not gonna touch on other good habits, as it seems already covered in general, but just going to add a few mindset related things I found that resonate with my experience:
Becoming smarter shouldn't be a goal in itself, as intelligence is already set. Whenever I spent days reading studies, reviews and guidelines trying to search for an edge or better health in general, it was mostly a form a entertainment. I did learn a lot with those deep dives, and I incorporated a lot of these things in my life, but the gains are very marginal over less detailed advice.
At this age your brain is already wired for specialization. Which is probably why learning from textbooks and other structured ways seems easier now than when you were young and exploring, learning by exposure. You can tell the difference especially with language-learning and music.
This is bad if you are just expecting to absorb a topic intuitively, but it doesn't mean you can't conquer and become an expert on it. Or become a quick responder at it. This is where after you have covered some ground, you continue learning using projects and examples.
Life is more complex also than in your early 20s. There's more to do in general, expectations from others and yourself, which sometimes gets in the way of learning, eventually becoming distracting and energy sucking instead of having everything taken care of, or not being bothered by it. You can optimize this by hiring help or finding ways to living a lower maintenance life, keeping a low maint. household.
I find whenever I take steps to simplify my life and time sinks, and take a little time off out of my usual environment, creativity in problem-solving and learning tasks follow.