In formal counseling , no-harm contracts can be helpful tools. This is a sample document that you can use. Help them develop a specific plan to reach out if they are feeling overwhelmed with despair. If someone will not agree not to harm themselves or doesn’t seem in the right frame of mind to make this promise, call 911 and get civil authorities involved.
If you’re interested in reading more, look into A P.L.A.N. to Engage a Suicidal Person Wisely.