How can you help a friend who want to commit suicide?

Call 911. If your friend confides that they are feeling suicidal, call 911, even if they don't want you to. This is a medical emergency requiring immediate attention. That is the best way to help them. Go with them to the emergency room and remain supportive. Talk to the professionals there to get a more comprehensive explanation of how you can help. Call 911 or go the emergency room immediately.
Listen Talk Listen. If you encounter a friend who is expressing thoughts of suicide, engaging them in a discussion about suicide is the single most powerful deterrent. Do not fall prey to the myth that "talking about suicide causes suicide." encourage your friend to talk about the reasons for this potential closed option decision. Listen to their concerns. One always has 911 for backup if you can't get them to talk.