I'd add a few things to my list.
Look at learning an instrument or a language as a hobby. It helps keep your brain active and it's thought to help stave off dementia / Alzheimer's.
For the same reason, get more friends. People with a wider friendship base tend to suffer less from mental health issues (it's the main reason why the old chestnut of "people who drink a little live longer", as they tend to get more sociable).
Magnesium supplements are a great idea if your diet isn't giving you enough. Bear in mind that it takes a long time to replenish magnesium (about 6 months), so it's not a quick fix. I've discovered my previously crippling migraines are no longer as painful since taking it (it affects the blood vessels).
Meditation. To the person who said they're rubbish, read "Full catastrophe living" by John Kabat-Zinn. He "invented" modern mindfulness in his treatment of stress and he corrected a lot of errors I've been making. Also consider a course like those from Monash University on Future Learn (they're free and excellent). Lastly, remember that each time your mind wanders off to a thought and you notice it, THAT'S meditation. That's when the good stuff happens. You're training your mind to focus. When it happens, GENTLY (like training a puppy) take your mind back to your point of focus and thank it for doing it's job. Mindfulness I cannot rate highly enough. It even reverses aging (look at telemeres). Just noticing the world around you rather than being on auto pilot (default mode - we spend about 50% of our day like this) can literally double your life experience.
Yoga is similar to mindfulness and has the benefit of keeping you flexible which is something age tried to insist you're not. Not all yoga is the same, but slow and gentle yoga focused on getting your body and in tune with your breathing is excellent. One of the best courses I ever did was an 8 week MBSR (mindfulness based stress reduction) course which combined meditation, yoga and CBT. It left me far calmer and more able to deal with my negative moods.
Screen time. We spend too long online. Dopamine is released every time there's a reply on a thread we're on and even more so if we get mentioned or quoted. That makes forums like this addictive. Addiction aside, people in social media tend to have worse mental health than those who are not.
Don't compare your life to others. Even those who seem to have everything tend not to be happy. You don't need "things" to while. Look at all the hype around decluttering. More stuff just gives you more to worry about and less time to do the important stuff.
Try not to worry. I was the world worst worrier. Never thought I would reach 50, but here I am and nothing major has gone wrong with my abused body. Remember, if you're breathing, that's more right with your body than wrong. Yes I looked in the mirror and was mortified by the old bastard looking back, but I got over that (my wife thinks I look even more attractive with reading glasses... Who knew?). I'm now comfortable in my skin. Probably for the first time ever in my life. When I actually was all muscled and fit I was crippled by shyness and low self esteem. Youth really is wasted on the young.
Diet - Mediterranean diet is supposed to be great for you. Ready meals are not (on the whole). A balanced diet is key. Never thought I'd be earning sauerkraut, but it's good for my gut biome and that's good for me. Careful on the supplements. You can overdo them and do more harm than good (including vitamins). A good diet is better than a pill, but if you're intolerant (I am) then they're a good idea. Watch your sugar intake. It's been linked to a while host of negatives. Intermittent fasting is getting some good press lately, but I don't know enough about that yet.
Water - essential. I never realised how much it negatively impacted my mood not drinking enough.
So, daily meditation. Daily or every other day exercise (needs to include some weights and impact). Less screen time and social media. A good diet.
On the personal side:
A nice holiday (you can even do this at home, there's so much we don't know about where we live)
Time spent alone (I'm doing this post in the bath with incense)
Long hugs.
Spoiling yourself with a good massage or spa day.
New clothes.
A new hand bag.
Nice makeup ( I'm a bloke, but my wife and mum tell me. My Goth days are well in the past!)
Outdoors with nature (forest bathing)
A good book / film
A new hobby - especially if you meet people.
Self learning. People get ou degrees in their 90's and they're a fantastic way of learning (much better than my school ever was)
Thinking about and helping others.
Smiling (it makes you feel happy even when you're not)
Journaling (it helps by showing the negative biased brain that your life isn't all bad)
Above all. Live in the moment. Live your current life to the fullest and the you're naturally preparing the best you can for the future.