If they need to let out their feelings try and allow them to, you don’t necessarily have to say something amazing in reply, just let them let it out.
Little actions such as sending a random text maybe saying ‘thinking of you’ ‘here for you’ or ‘I think you’re amazing’ or a hug (if they like hugs) can go a long way. Maybe a small gift or offer to meet them out to eat somewhere.
Don’t be surprised/take offence if they maybe don’t reply to your texts/go a little cold/be disinterested in having friends because they make just not be feeling like doing anything. They may also accidentally be rude/snap out. If they do do this, try not to get angry as it will make them feel worse, and they actually can’t control it.
As I said above, the best thing you can do is support them in getting help.
I hope this helps both of you, please feel free to ask anything about it/or ask for more stuff.
As to the OP some more details wouldnt go a miss. Its hard to know how to answer if we dont know the cause, if they have any other problems etc. e.g. someone with depression and trauma will require a different approach to someone who just has 'simple' depression and so on.