People usually attempt suicide to block unbearable emotional pain, which is caused by a wide variety of problems. It is often a cry for help.
A person attempting suicide is often so distressed that they are unable to see that they have other options: we can help prevent a tragedy by endeavoring to understand how they feel and helping them to look for better choices that they could make.
Suicidal people often feel terribly isolated; because of their distress, they may not think of anyone they can turn to, furthering this isolation.
In the vast majority of cases a suicide attemptor would choose differently if they were not in great distress and were able to evaluate their options objectively.
Most suicidal people give warning signs in the hope that they will be rescued, because they are intent on stopping their emotional pain, not on dying.