So what is going on in the psychology of someone who commits suicide? Studies using psychological scales that evaluate the different dimensions of depression reveal that (unsurprisingly), those individuals most likely to die by suicide are those who score high on the hopelessness scale. (Beck, 1986) The more hopeless a person feels, the fewer options they perceive for ending the unhappiness.
Other research has shown that people who score high in negative emotions such as anxiety, anger, fear and stress were even more likely to try to kill themselves than people who scored high in impulsivity. (Springen, 2010) Having unrealistic standards about life or being brought up in a rigid and inflexible belief system not only feed into these negative emotions, but they prevent a person from seeing their situation in a less-judgmental way, which makes them more likely to commit suicide.
Repeated exposure to the idea of taking your own life makes one grow more comfortable with the thought, thus increasing suicide risk. Which is why it's important for friends and family to intervene as soon as possible once they become aware that a loved one may be having such thoughts. The more time they spend priming themselves to the idea of taking their own life, the more likely it is to occur. It's sort of like football players who jump up and down and hit each other to get psyched up for the big game. Someone who is suicidal may spend a lot of time imagining their demise in order to build up the strength to actually do it.