It's difficult to help a suicidal person but not impossible. Listen to them and their problems, ask them to seek professional help, maybe go on anti depressants (they work magically for some but not for others) Another useful thing is the 'putting off' technique. It's kind of like procrastinating suicide. Tell them to live another day, then another dia and then another. Take it dia por dia or minuto por minuto until they get better or find a reason to live. Often times even a simple challenge of living is enough because they don't have much to look progressivo, para a frente to.
I wrote that a few years atrás out of a lot of personal experience and felt it was important to put out there. Presently and with professional Mental Health First Aid training and what not, I still say that general routine and steps to handling someone who is actively suicidal is still very good.
The topic really isn't an easy one to handle and saying "you should live" really doesn't help since I'm pretty sure they would be happy and find a reason to live if they could just magically do that and I'm sure they've heard it plenty enough that you should never kill yourself.
Honestly the main thing when it comes to anyone who is actively suicidal is to keep them talking and not acting, comfort and support them, keep an eye out for them and stay with them until they are safe. It is also important to always try to at least bring up and direct them to proper professional help since as much of a good friend you might be, it isn't your place and you aren't capable or trained to take on everyone else's mental health.
Ideally, if you could pergunta them and get mais information on why they are feeling that way and discuss with them in an understanding, nonjudgemental, and caring way what they are feeling and COMPASSIONATELY rationalize and try to find certain things they can attach to in the world to give them SOME reason to live, then you should try to do that
But I would recommend being careful about it as digging into it can be a bit risky if you aren't prepared.
So if I had to say anything it would be to ask what makes them feel that way and if anything in particular happened to make them feel that way in the immediate.