Assure them that they're not alone
Someone who is considering suicide eventually separates themselves from others. At that point those thoughts convince them that they're completely alone, which makes them lose all hope.
What they need is for someone to understand how they're feeling and they especially need to hear over and over again that they're not alone.
Those words can help restore hope again up to where they abandon any plans they had in place.
Offer them a listening ear
Allow them to open up to you and express how they're feeling. They have probably felt like no one has the time to listen and understand what they have been going through and that is why they're actually seeing that suicide is the only way.
Therefore, ensure them that you're willing and ready to listen. No distractions, no rushing and no interruptions. And especially no judgements at this point in time.
Don't minimize their struggles
Life requires a lot of strength and resilience. But we also need to understand that what you can handle isn't what someone else can handle.
So, if you're talking to them and what they're saying wouldn't be a cause to give up on life from your perspective, that's okay. But the worst move you can make is to show them that what is troubling them isn't a big deal because that will only make the situation worse.
Connect them with a professional
Don't give them the responsibility of finding help because they don't have the strength to do it alone. Part of offering adequate support is doing the work to get them some assistance.
Find suicide hotline numbers, counsellors and other professionals who know how to deal with the situation more professionally as you continue encouraging and being there for them.