This might not be right for everyone because getting invested in anything always opens you to the opportunity for disappointment and heartbreak, but honestly and surprisingly, one of the best things for my mental health has been my borderline territorial attitude towards the areas that I've lived in, by which I mean literally thinking like "EXCUSE ME. NO BAD THINGS IN MY JURISDICTION."
To the point that while I was at college, people from my hometown would tag me or send me articles whenever Some Bullshit was occuring in our area, and I would march back home the next break like "Who authorized this?" even though I was in my late teens/early twenties with no formal power or authority in my hometown area.
But for real, nothing gives you a greater sense of purpose or community than doing an art fundraiser for your hometown's old movie theater that may close; or using part of your break to help a small local bookstore move all their stock to a new place after the mall they were in closed and kicked out all the businesses at Christmas; or compiling lists of alternatives to plastic after your nearest city lost its recycling contract, etc.
The internet provides us a certain community, but there's really no substitute for caring about where you live and the quality of life of the people around you.
So if you're feeling like something is missing in life, maybe go out for a walk, pick up some litter, read some local flyers, check out a local newspaper, gossip with the shopkeepers, and see if there's a community need that you might be able to help fill. It just might help fill something empty in you in the process.
P.S. It's okay if you don't have the energy to "consistently" show up for your community like this. But from time to time, you might find it's nice to get out into the place you live in a world where it's more common to deeply know someone on the other side of the world through a cell phone app than it is to know your neighbors.