Listen to her. Some things can't be fixed. For those things, the listening itself is the cure. She needs to tell someone how bad she feels. When you've listened, and heard her, and she knows she has been heard, that is the cure right there.
After she has had a chance to fully tell you her feelings, then you can tell her your feelings. E.g. "I feel scated when you say you want to kill yourself, because i really like you and care about you, and i would feel devastated."
You may also ask a councelor, school counselor, church pastor, anyone who's in the business of helping people, if they can help you furthet with this type of listening.
There's also a book titled "Non-violent Communication" by Marshal Rosenberg which covers this topic in depth. (Lousy title. I'd title it Compassionate Communication". )
And a counselor or other person can help you express your own feelings about the situation. We take care of ourselves and our emotional needs, so that we in turn will then be able to care for othets.
Please tell her parents, or a school counselor, or an adult you trust. Your friend needs mental health help before it is too late. She may be mad at you for awhile for telling on her, but isn't that better than her being dead? Better to have an angry friend who is alive and hopefully, more mentally healthy.