Mindfulness is emphasized in CBT (cognitive behavioral therapy). The idea behind this is that depression manifests as distorted thoughts (e.g. "Everyone hates me, I should die."), and the goal is to notice these thoughts and learn to substitute them (eventually automatically) with thoughts that are more productive/positive.
From what I've seen, most meditation practices are very helpful for the "notice the thoughts" part, but, especially in non-religious settings, tend to neglect the "substitute the thoughts" part. Usually what I hear is something like "notice the thought and let it go."
So if the thought "Everyone hates me, I should die" comes up during meditation, you just notice it and let it go. That often provides some relief in the short term (you're no longer actively thinking about dying), but you've done nothing to prevent it from arising again later, and you haven't learned any coping techniques for when similar thoughts won't go away (which can be a symptom during severe episodes). If you have depression or anxiety and want to get into meditation, I would strongly suggest at the very very least researching the principals of CBT in case you find yourself in this situation. I would recommend an app called Woebot. Even better would be to try some actual CBT if you are able.
All that said, I think that for me joining a meditation group was beneficial for me because of the social aspect more so than the actual meditation. This group emphasizes community (sangha) and service pretty heavily. A lot of people get social benefits from other religious communities, but as someone who didn't grow up in a religious household, I find Buddhists super easy to get along with. They tend to be very accepting, especially to newcomers, since they are taught not to make judgements of others. It's comforting to know if I'm going through a rough patch that at least I don't have to worry about people judging me for missing meditation that week.