What are some good ways to help my friend, a teenage girl, not to commit suicide?

Hospital. Suicidal tendency is an emergency. She has to be hospitalized for counselling by a psychiatrist especially if depressed.
Get Help ASAP. Be there for support, but guide her to professional help asap. And if you are concerned, it is safer to violate her confidence and let a responsible adult help instead of suffering tragic consequences.