(coming from someone that’s attempted to)
you should
1. listen to them talk about how they feel if they are comfortable with doing so
2. reassure them they are loved by u and others
3. help them find ways to cope and try to cheer them up
4. tell someone else to get them help if they are in the process or making plans to commit
5. be careful what you say to them they are probably not in a stable emotional state