It was narrated from Thaabit ibn Dahhaak رضیﷲ عنه that the Rasool صلی اللہ علیہ وسلم said:
“Whoever kills himself with something will be punished with it on the Day of Resurrection.”
[Bukhari and Muslim]
It was narrated that Jundub ibn Abd Allaah رضیﷲ عنهsaid: Rasool صلی اللہ علیہ وسلم 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. Allaah, may He be glorified and exalted, said: ‘My slave hastened his death; I have forbidden Paradise to him.”
[Bukhari and Muslim]
But a person who committed suicide is not a disbeliever and he can be in Jannah based on his some specific deed which he carried out in this Dunya might land him in Jannah If Allah wishes.
Saydna Jabir رضیﷲ عنه reported: When the RasoolAllah صلی اللہ علیہ وسلم emigrated to Medina, Al-Tufayl ibn ‘Amr also emigrated along with a man from his people. They strongly disliked the climate of Medina and the man became sick and suffered from anxiety.
He took some of his arrowheads, cut the joints of his fingers, and his hands bled out until he died. Al-Tufayl saw him in a dream looking as if he were well but his hands were covered.
Al-Tufayl said, “How has your Lord treated you?” The man said, “He has forgiven me due to my emigration to His Prophet.” Al-Tufayl said, “Why do I see your hands covered?” The man said, “I was told that ‘we would not repair what you yourself have ruined.’” Al-Tufayl told the story to the Rasool صلی اللہ علیہ وسلم, and the RasoolAllah صلی اللہ علیہ وسلم said, “O Allah, and for his hands forgive him.”
[Sahih Muslim 116]
Imam Nawawi رحمہ اللہ said,
فَفِيهِ حُجَّةٌ لِقَاعِدَةٍ عَظِيمَةٍ لِأَهْلِ السُّنَّةِ أَنَّ مَنْ قَتَلَ نَفْسَهُ أَوِ ارْتَكَبَ مَعْصِيَةً غَيْرَهَا وَمَاتَ مِنْ غَيْرِ تَوْبَةٍ فَلَيْسَ بِكَافِرٍ
“In this tradition is proof of the important principle for the people of the Sunnah, that whoever kills himself or otherwise commits a sin and dies without repenting is not considered an unbeliever.”
[Sharah An Nawawi Ala Sahih Muslim 116]
Shaikh Salih al Munajjid says:
The believer has to be patient and to seek the help of Allaah, 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 Allaah 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 Allaah with no burden of sin.
The Prophet (blessings and peace of Allaah 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-Bukhaari (5642) and Muslim (2573).
[Islamqa]