If it is a service person, inform 999, the police may then contact their unit to explain what has happened.
Do not be afraid of breaking confidentiality...they are considering taking their own life, it cannot get any worse.
Would you rather someone got upset with you and were crying on your shoulder, or that you were attending their funeral?
If it is a service person or a family member; once they are safe and with emergency services contact their unit or home base and explain the situation. This will trigger medical/pastoral and welfare support from the RN.
If in service, contact your divisional officer or senior rate.
Talk to someone you trust. Taking and listening has been proven to relieve a lot of built-up stresses and negative thoughts.
You will have your CPN/DCMH contact details and hours of operation. Talk to them, they are there to help.