This is gonna sound heartless but honestly you shouldn't have to comfort them in a way like therapists do, you aren't a therapist and frankly nothing will help if they can't help themselves right now. Please advise them to get professional help or if they can't get some, try your best to get them to reach out for a family member or someone closer to them because as someone who's been both the 'therapist friend' multiple times from a young age and also became someone who was previously suicidal; online consoling works sometimes for certain problems but shouldn't be YOUR responsibility for something as serious as k*lling themself cuz it's going to fuck up your own mental health in the long run. I'm not saying don't help them but please try to sway them into the right direction, it'll be the healthiest for both you and them.
Just being there. You can't motivate a depressed person but you can show your support by staying at their side. Offer your shoulder and your ear without pressuring for a solution. If things get worse you have to talk to someone professional or someone with the know how to take responsibility for that situation. There are also hotlines you can contact.

hello, as the title says. i have a close online friend that’s constantly posting stories about how unhappy they are and recently they’re mainly about how they want to unalive themselves. i care a lot about this friend and i usually try to send them motivational messages every now and then but i’m at a point where i don’t know if what i say can even make them feel better/help them. does anyone have tips?