All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Suicide is a major sin, and its perpetrator is threatened with painful punishment. Allah Almighty has threatened the one who kills himself that He will burn him in Fire, as in Allah Almighty’s saying (what means): {...And do not kill yourselves [or one another]. Indeed, Allah is to you ever Merciful. And whoever does that in aggression and injustice - then We will drive him into a Fire. And that, for Allah, is [always] easy.} [Quran 4:29-30] The meaning of "drive him to fire" is to put him in fire to touch and feel its heat.
In addition, the Sunnah indicates that whoever kills himself with something, he will be punished with it in the Hellfire forever. As in Saheeh al-Bukhari and Sahih Muslim, it is narrated on the authority of Abu Hurayrah that the Messenger of Allah said: “He who killed himself with steel (weapon) would be the eternal denizen of the Fire of Hell and he would have that weapon in his hand and would be thrusting that in his stomach forever and ever, he who drank poison and killed himself would sip that in the Fire of Hell where he is doomed forever and ever; and he who killed himself by falling from (the top of) a mountain would constantly fall in the Fire of Hell and would live there forever and ever.” [End of quote]
Moreover, the fact that a person is upright in obedience to Allah and then ends his life by committing suicide is a bad end -Allah forbid-, and the lesson is what action (deed) a person's life is ended with, as the Prophet said: “One man does the deeds of those who go to Hell but is one of those who go to Paradise, and another does the deeds of those who go to Paradise but is one of those who go to Hell, for judgment is given according to one’s final actions.” [Al-Bukhari and Muslim] In another Hadeeth, the Prophet said: “By the One besides Whom there is none other worthy of worship! One of you will do deeds of the people of Paradise until there is between him and it but a forearm span, then he is overcome by what is written for him, and he is sealed off with the deeds of the people of the Fire, so that he enters it.” [At-Tirmidhi] Therefore, fear Allah, dear brother, the questioner, and you mentioned in a previous question that you want to commit suicide, and beware lest Satan lure you into killing yourself and tempt you that suicide won't harm you by claiming that you are a righteous person, as this is one of Satan's tricks, and the illness that that you are afflicted with is not a justification for suicide. Furthermore, you have a good example in the Prophet of Allah, Yaqoub when he fell ill and people fled from him, and only his wife remained with him. Despite that, he was patient and turned to Allah Almighty. He did not despair of Allah's mercy and did not despair of his recovery. So, Allah the Almighty rewarded him in this world and the Hereafter for his patience, as Allah Almighty says (what means): {...Indeed, the patient will be given their reward without account.} [Quran 39:10]. Thus, make your illness a reason to enter Paradise with your patience according to Allah’s Decree, and do not make your illness a reason to enter Hellfire -Allah forbid.
Allah knows best.