Asalaam Alaikum
what i have found regarding this matter is that it is something that the scholars have differed about. some approve of it while others does not and this is also very much evident if we look at the main four schools of thought. to come to an understanding and a definitive conclusion in such matters where the scholars of our ummah also have differed is not going to be easy and i believe it would depend on the personal preference of the individual in the end, that is only after evaluating and going through all the available evidences for and against it.
i will try to clarify a little as this subject is very sensitive and vast, insha Allah.
at first let us remind ourselves of this hadith,
From Abu Hurairah RA, the Prophet (ﷺ) said, "There is no disease that Allah has created, except that He also has created its treatment. [bukhari 5678]
now among the evidences about this matter ill quote a few, insha Allah.
Shaykh al-Islam (may Allah have mercy on him) said: It is not obligatory according to the majority of leading scholars; rather a few of the companions of ash-Shaafa‘i and Ahmad regarded it as obligatory. Quoted by as-Safaareeni in Ghidhaa’ al-Albaab (1/459).
It says in Tuhfat al-Muhtaaj (3/182): ‘Iyaad narrated that there was consensus on the fact that it is not obligatory, but some suggested that in some cases it could be obligatory if a person has an injury from which he fears that he will die.
now let us look at the other perspective,
In Haashiyat Qalyoobi wa ‘Umayrah it says: al-Isnawi said: It is haraam to neglect medical treatment in cases such as an injury where it is thought likely that a person may die
i believe it is worthy to mention from IFC as well,
The Islamic Fiqh Council is of the view that medical treatment is obligatory if not treating the problem will lead to loss of life or limb, or incapacity, or if the harm of the disease may be transferred to another person, as in the case of contagious diseases.
to come to one single conclusion purely depends on the individual. there are a lot of arguments on both the sides. just for the record i'll quote from the encylopedia of figh as well,
"The majority of the scholars held that refusing treatment when one is sick is not considered suicide. A sick person who refuses treatment until he dies is not considered sinful, because it is not certain that this treatment would cure his sickness..."
for the scholars that says it is not obligatory, they cite the following hadith as evidence,
narrated by Ibnu ‘Abbas RA: “Show endurance as you can do and there would be Paradise for you and, if you desire, I supplicate Allah that He may cure you. She said: I am prepared to show endurance,” [Sahih al-Bukhari (5652) and Sahih Muslim (2576)]
i hope this much just gives a basic idea about the view among our scholars regarding this issue. i would like to mention one more quote just for more clarity, as i believe it is relevant to the question.
Imam Ibnu Kathir said: “And Allah SWT is the One who permits the healing of certain diseases, while we should make an effort and take preventive measures that could lead to the healing or cure such as getting treated from ahlu al-ikhtisas (people with expertise), they are experts in the field of medicine. Thus, neglecting reason and effort is a curded matter in religion while tawakkal or supporting a decision solely on reason is something that is cursed in tawhid.” (Refer Tafsir al-Quran al-Karim, 5/131)
it is true Allah the mighty and sublime has all the power to decide who lives and who dies but we must always remember that we should hold firm to life untill there comes the certianity.
on a brotherly note, i would like to remind you and me of this following hadith.
Narrated Anas bin Malik:
The Prophet (ﷺ) said, "None of you should wish for death because of a calamity befalling him; but if he has to wish for death, he should say: "O Allah! Keep me alive as long as life is better for me, and let me die if death is better for me.' " [ Sahih al-Bukhari 5671]
may Allah the mighty and sublime grant you mercy and guide you to the straight path.
Allah knows best.