"There is but one truly serious philosophical problem and that is suicide. Judging whether life is or is not worth living amounts to answering the fundamental question of philosophy."
-- Albert Camus, The Myth of Sisyphus and Other Essays (1942).
One may question, in a contemporary view, Camus' association of the matter of suicide as the fundamental question of philosophy. Disciplinary boundaries move over time, and increasingly there are pragmatic reasons why philosophy is increasingly associated with foundational matters of epistemology, ontology, and logic; even if there were no humans alive these matters would still, in potential, exist. The matter concerning suicide is perhaps more a matter of normative moral reasoning and situational ethics, coupled with questions on the psychology of life. Camus would disagree, of course. He takes issue with the argument of the importance of ontology, for example, by citing how quickly Galileo abjured it when his life was at stake. But regardless if one shifts the disciplinary boundary, the importance of Camus' statement from a subjective perspective cannot be under-estimated. As is well known, Camus argues that existence is absurd, without innate meaning, and in this regard he does certainly raise an ontological challenge, not to the individual, but to existence itself. Suicide then becomes a symptom to the meaningless, the recognition that life is not worth living. Faced with objective meaningless, Camus asserts authenticity where the subjective, even recognising their own limits, creates meaning in "revolt" against objective absurdity. This is, quite obviously, prior to the linguistic turn in philosophy which now locates the greatest meaning as being generated through the relationship of trust and promises between authentic people.
It is important, from the outset, to recognise the enormous influence of the social environment on suicide. For all its flaws, the classic study by Durkheim is one of the most important contributions to the development of sociology. What is supposedly a thoroughly private act has enormous social biases. Contemporary studies continue to confirm Durkheim's prognoses in this regard. Those communities with stronger social integration and communualism experience less suicide that those which are more individualistic, both between nations and within them. In Hungary the suicide rate is 66 per 100 000 whilst in Mexico it is 2.5 per 100 000, within the United States the relative risk of a white male versus a black female suicide, controlling for age, is almost 10 to 1. Naturally enough, such values have multiple trajectories and particular environments are conducive; suicide is the leading cause of death in the U.S. prisons, with the majority occuring in the first 48 hours. Further, there is significant evidence of "suicide contagion", including fictional inspirations. As Andrew Solomon has pointed out, you are statistically more at risk to commit suicide even by merely reading this article (and as for the author writing it, the risk is even greater). The social aspect obviously also applies in the terms of the method used; in Hong Kong the prevalence of high buildings has meant the majority of suicides are from jumping; in India and rural China from pesticide poisoning, and in the United States by gunshot.
Whilst there are enormous social biases in the rate of suicide it is in terms of results, in terms of actions it is certainly an individual act even if this is, to a a degree, something of an illusion. Thus, it is not surprising to discover that religious thinkers from traditional times phrased their perspectives in such manner. Those from a traditional Christian ethic (e.g., Augustine), equated the act of suicide with murder, although with the effective "suicide by cop" by Jesus, is considered acceptable. As a resuls suicides were historically refused Christian burials and various restrictive laws in Christian-dominant countries were introduced. To this day, Catholicism in particular argues against voluntary euthanasia as "medically assisted suicide". In the other Abrahamic religions there are differing perspectives. Islam is certainly the most restrictive with a clear prohibition (Quran 4:29), which includes suicide in warfare, official or otherwise, whereas Judaism largely disapproves with exceptions for transgression of cardinal laws (Kedoshim), which may include martrydom, and with liberal views sympathic to voluntary euthanasia. This all compares quite strongly with the Dharmic religions which are more accepting of suicide under specified conditions. Buddhism, for example, largely views most suicides in a negative fashion due to attachment, but will also accept "self-euthansia" for those in extreme and incurable pain. Likewise, in Jainism and Hinduism, suicide is considered a violation of the non-violent ethic of ahimsa, but with santhara and prayopavesa, suicide by fasting when one has no responsibilities or ambitions to be acceptable.
It is inevitable that religious justifications for and against suicide incorporate secular considerations, for example the degree that Dharmic suicide matches the utilitarian justifications in the contemporary debates on voluntary euthanasia. Likewise we find this is the naturalistic approaches to life, both in the philosophical school of stoicism and the aesthetic school of romanticism. Simplifying many nuances, romanticism is understood as an emphasis on the emotional and visceral experience, especially those which can be disruptive and extreme, but also are the deepest passions and convictions. This can include madness, love, terror, awe, etc. In contrast, the stoic approach has an emphasis on fatalism, virtue, and rational thinking. An initial consideration would place these two approaches in life, separated by over two thousand years in their origins, as quite incompatible. But it is perhaps more appropriate to think of them instead as two approaches that are conflict, and are always part in the same person. It seems that everyone has a rational side and a romantic side, that one may be greater than the other, or the admixture between the two can be more or less, or that the depth and extent varies between and within individuals.
From the Stoic point of view, Epictetus famously remarked in the Discourses that the opportunity always existed: "Has someone made smoke in the house? If it is moderate, I'll stay. If too much, I exit. For you must always remember and hold fast to this, that the door is open." Death itself is not be feared, but rather it can be rationally carried out when is is no longer possible (e.g., due to enslavement, incurable illness) to carry out virtuous actions. The Stoics are very critical, for example, of the foolish romantics who kill themselves out of unrequited love. The strict Stoic point of view however does not seem to give sufficient credit to how such experiences are very much an illness in themselves, a point well made by Gabriel García Márquez embedding it in the title of the novel "El amor en los tiempos del cólera".
Perhaps some insight from utilitarianism can be applied here, using one of the more objective pain scales. Whether through mental or emotional health as well as physical health, if a person finds that they are unable to function in a virtuous fashion because of the degree of pain, and they have tried all manner of potential curatives, from counselling, psychoanalysis, medicines etc, then suicide actually represents a final wilful act of dignity for that person. This is certainly the libertarian political position that David Hume came to in his unpublished essay "Of Suicide" (1783), and Schopenhauer's "The World as Will and Representation" (1818). This position, both morally and politically, still has the greatest credibility.
Graeme Bayliss, in The Walrus (2016) considers this matter in some detail stating quite bluntly that regardless of therapy, for a lot of people it simple does not get better and can, in fact, get worse. Nevertheless, various Voluntary Euthanasia legislation in many countries of the around the world (e.g., Canada, Australia) argues that those with a mental health condition are deemed as cognitively incapable of seeking medically assisted suicide, and must instead find their own path without dignity or peace. As Bayliss points out, this is a Catch-22: "I don’t want to live, but the very fact that I don't want to live means I can't possibly consent to die". Whilst it is generally accepted that medically assisted suicide is legimate for those suffering incurable physical pain, with all sorts of evaluations and caveats in place, our society has not yet evolved sufficiently to understand that a illness within the brain can be just as debilitating or as painful, and that forcing people to remain alive with such conditions and no hope of cure robs them of their dignity and their freedom; such a torture is a life not worth living.