Just so we don't bury the lede, you can play a very important role in helping someone who is grappling with suicidal thoughts, but you're not a professional and you can only do so much. Your goal is to get a person the help they need; when, how, and what kind of help will differ from situation to situation (which we'll go over), but here is all the important stuff, right up top:
National Suicide Prevention Lifeline can be reached at 1-800-273-TALK (8255).
Crisis Text Line can be reached by texting HOME to 741741.
Suicide helplines outside the US can be found here.
911 is not just for obvious physical life-or-death emergency — it's a totally viable option if you’re not sure where to start and you need help now.
Primary care doctors are a great first step in a non-crisis situation for someone who doesn't have a therapist or counselor. Call their office and say, “I’m a patient (or friend of a patient) of so-and-so’s. This is what’s happening. What do you think I should do?” — which might mean making an appointment or utilizing another resource the office suggests.
You can learn about what other options are available in a mental health crisis here.