Praise be to Allah.
Is suicide haram?
Suicide is a major sin , and the one who does that is faced with a warning of eternity in the Fire of Hell, where Allah will punish him with the means that he used to commit suicide.
Abu Hurayrah (may Allah be pleased with him) narrated that the Prophet (blessings and peace of Allah be upon him) said: “Whoever throws himself down from a mountain and kills himself will be throwing himself down in the Fire of Hell for ever and ever. Whoever drinks poison and kills himself will be sipping it in the Fire of Hell for ever and ever. Whoever kills himself with a piece of iron will have that iron in his hand, thrusting it into his belly in the Fire of Hell for ever and ever.” (Narrated by al-Bukhari (5442) and Muslim (109)
Thabit ibn Dahhak (may Allah be pleased with him) narrated that the Messenger of Allah (blessings and peace of Allah be upon him) said: “Whoever kills himself with something will be punished with it on the Day of Resurrection.” (Narrated by al-Bukhari (5700) and Muslim (110)
Jundub ibn ‘Abd-Allah (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “A man among those who came before you was wounded. He panicked and took a knife and cut his hand, and the bleeding did not stop until he died. Allah, may He be glorified and exalted, said: ‘My slave hastened his death; I have forbidden Paradise to him.” (Narrated by al-Bukhari (3276) and Muslim (113)
Patience in the face of calamities and hardship
The believer has to be patient and to seek the help of Allah, may He be exalted, and understand that no matter what hardship befalls him in this world -- no matter how severe it is -- the punishment of the Hereafter is worse than it. It is not acceptable according to anyone who is of right mind to run away from the heat of the desert and throw himself into the fire. How can he flee from temporary hardship and difficulty -- which inevitably will come to an end -- to an eternal punishment which has no end?
The Muslim should ponder and realise that he is not the only one in this world who is affected by calamity and hardship . Calamities befell the greatest of mankind, namely the prophets, messengers and the righteous. They also befell the worst of mankind, namely the disbelievers and atheists.
Calamity is part of the natural order of things and hardly anyone is safe from it.
If the believer handles it well and is patient, and it becomes a means that makes him turn back to Allah and strive hard in worship and righteous deeds, then the calamity will have been good for him and will be expiation for his sins, and perhaps he will meet Allah with no burden of sin.
The Prophet (blessings and peace of Allah be upon him) said: “No pain, hardship, sickness or grief befalls a believer, not even worry that befalls him, but some of his bad deeds will be expiated.” (Narrated by al-Bukhari (5642) and Muslim (2573)
Al-Tirmidhi (2399) narrated that Abu Hurayrah (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Calamities will continue to befall believing men and women in themselves, their children and their wealth, until they meet Allah with no burden of sin.” (Classed as sahih by al-Albani in Silsilat al-Ahadith al-Sahihah (2280)
Committing suicide because of mental illness
If the suicide is due to mental illness that has had such a far-reaching impact on a person’s reason that he is not aware of what he is saying or doing, if in such a case it so happens that he killed himself, then he will not be with the sinners who have committed the major sin of suicide; rather he will be excused. That is because this person was no longer accountable due to severe mental illness that led to loss of reason.
And Allah knows best.