When asking around, I've never heard anyone agree that a young, healthy person should end their life by suicide. But I also don't know what reason there is for that consensus.
Did Buddha teach anything regarding what makes life worth living?
The first book I read about Buddhism described the Sermon at Benares, i.e. the Dhammacakkappavattana, as explaining that the cause of suffering (the second noble truth) is,
... the craving to have what you don't have; the craving to keep what you can't keep; the craving to live; even the craving to die.
And here is the same quote from Access to Insight,
"And this, monks, is the noble truth of the origination of stress: the craving that makes for further becoming — accompanied by passion & delight, relishing now here & now there — i.e., craving for sensual pleasure, craving for becoming, craving for non-becoming.
"And this, monks, is the noble truth of the cessation of stress: the remainderless fading & cessation, renunciation, relinquishment, release, & letting go of that very craving.
So I think that suicide must be missing the most important, fundamental truth of Buddhism.
Suicidal ideation is a risk factor: Suminda said, "You shouldn't even think about things like suicide".
Similarly, the "middle way" doctrine says not to afflict or self-mortify the body. And, the doctrine of rebirth suggests that, although there are problems in life, these problems can't be escaped simply by dying. It was by 'unbinding' (not suicide) that in the Ariyapariyesana Sutta the Buddha said,
I reached the aging-less, illness-less, deathless, sorrow-less, unexcelled rest from the yoke: Unbinding. Knowledge & vision arose in me: 'Unprovoked is my release. This is the last birth. There is now no further becoming.'
According to the Vinaya even 'describing the advantages of dying' is wrong.
This, the third type of act covered by this rule, can include [...] telling a person of the miseries of life or the bliss of dying and going to heaven in such a way that he/she might feel inspired to commit suicide or simply pine away to death. [...] Thus, the Commentary notes, a bhikkhu talking to a dying patient should be very circumspect in how he chooses his words, focusing not on how to speed up the dying process but on how to inspire the patient with the following thoughts: “The attainment of the paths and fruitions is not out of the ordinary for a virtuous person. So, having formed no attachment for such things as your dwelling, and establishing mindfulness in the Buddha, Dhamma, Saºgha, or the body, you should be heedful in your attention.” The Vinita-vatthu to Pr 4 contains a number of stories in which bhikkhus comfort a dying bhikkhu by asking him to reflect on what he has attained through the practice, which was apparently a common way of encouraging a dying bhikkhu to focus his thoughts on the best object possible. The suttas also contain advice on how to encourage patients facing death. See, for example, MN 143, SN 36.7, and AN 6.16. In all of these cases, the advice is aimed not at precipitating death but at inspiring calm and insight.
As for "what makes life worth living": Buddhism can even seem quite 'negative' ("life is suffering") ... and so I asked this question, How to explain what Buddhism is? ... and people's answers to that explain it in more 'positive' or constructive terms: morality; concentration; and wisdom.
My dad told me, when I was young, that suicide is painful for the friends and family who are left behind (i.e. it causes suffering for others): I thought, even that is enough reason to avoid suicide.
And, for example, I lived with a friend: who became relatively enlightened, especially during the last year of her life. So it was more perfect, for her and for others, that she lived as long as she did, instead of dying earlier.
Perhaps what makes life worth living is that it's an opportunity to "live the holy life".
Many Buddhist descriptions try to describe the experiences of one person (e.g. in meditation), or even of 'no self'.
But part of the "holy life" is in the relationships between people, for example,
As he was sitting there, Ven. Ananda said to the Blessed One, "This is half of the holy life, lord: admirable friendship, admirable companionship, admirable camaraderie."
"Don't say that, Ananda. Don't say that. Admirable friendship, admirable companionship, admirable camaraderie is actually the whole of the holy life.
Perhaps you don't feel you have that (or are that) at the moment but there is every chance you might in future.
Unfortunately there are things which can make life seem unimportant: bad companions, "heedlessness", "restlessness", etc.
Instead, try to remember what Right intention is:
And what is right resolve? Being resolved on renunciation, on freedom from ill will, on harmlessness: This is called right resolve.
Also, problems are fixable: problems, too, are 'conditioned' and therefore changeable.
Have you been to see a doctor about this? Depression can cause life to lack appeal. Why is life worth living is one of those questions that cannot be answered in words, it's an inner feeling that doesn't need an explanation that most have felt at some point. It's a sign of good health to have a passion for life.
If whatever is causing you to feel that life is bleak changes, as it inevitably will, a passion for life can automatically emerge in you.
Life and death are two aspects of the same movement. By dying, the Buddhist would say, you don't really escape, for your return to life is guaranteed. Whether it is life as a human or not is another matter. So, what else is left if suicide doesn't improve things?
Given that life and death are one continuous movement, ever occurring, it makes sense to learn to live and learn to die.
Living in misery and dying in misery are common but not necessary.
Get tested for depression, and perhaps meditate with a good teacher in a monastery. The compassionate surroundings may trigger a change towards joie de vivre in you.
You shouldn't even think about things like suicide. Thoughts will be full of negative emotions and states that it will drag you to lower planes.
When you are doing the act you will have negative thoughts which would mean that your next life is bad.
You are also breaking the precept of not killing which is very grave.
Also it is best you see a doctor but until then practice Metta to your self and others.
The sutta doesn't say that the Buddha allowed him to commit suicide. When Mara reported this to the Buddha, venerable Godhika committed suicide. Then the Buddha saw what has happened and said that he has attained Nibbana.
According to Bhikkhu Vinaya, the only allowable act that comes close to committing suicide is rejecting medication, if you are suffering from a terminal illness and being a burden to everyone around you.
This Scientific American article describes some of the benefits of mindfulness:
As a remedy for depression and anxiety, mindfulness meditation may help patients let go of negative thoughts instead of obsessing over them. Training people to experience the present, rather than reviewing the past or contemplating the future, may help keep the mind out of a depressive or anxious loop.
If you have thoughts that are repeating in a loop, perhaps you are focusing on those thoughts, intentionally or unintentionally, and as suggested above mindfulness meditation may be a solution.
You may read A Guided Meditation by Thanissaro Bhikkhu to understand how to practise mindfulness meditation. If The Five Hindrances to practice disturb you, you can find the antidotes in this essay by Ajahn Brahmavamso.
What is the purpose of life? Well, the purpose of life is to experience true happiness. That's one way to look at it. From the Thanissaro essay:
Then bring your thoughts back to the present. If you want true happiness, you have to find it in the present, for the past is gone and the future is an uncertainty. So you have to dig down into the present. What do you have right here? You've got the body, sitting here and breathing. And you've got the mind, thinking and aware. So bring all these things together. Think about the breath and then be aware of the breath as it comes in and goes out. Keeping your thoughts directed to the breath: that's mindfulness. Being aware of the breath as it comes in and out: that's alertness. Keep those two aspects of the mind together. If you want, you can use a meditation word to strengthen your mindfulness. Try "Buddho," which means "awake." Think "bud-" with the in-breath, "dho" with the out.
Try to breathe as comfortably as possible. A very concrete way of learning how to provide for your own happiness in the immediate present — and at the same time, strengthening your alertness — is to let yourself breathe in a way that's comfortable.
And what to do when your negative thoughts come back over and over to disturb you? The essay continues:
If your mind wanders off, gently bring it right back. If it wanders off ten times, a hundred times, bring it back ten times, a hundred times. Don't give in. This quality is called ardency. In other words, as soon as you realize that the mind has slipped away, you bring it right back. You don't spend time aimlessly sniffing at the flowers, looking at the sky, or listening to the birds. You've got work to do: work in learning how to breathe comfortably, how to let the mind settle down in a good space here in the present moment.
The following only is relevant if you follow Buddhism\ the following are all from Shantideva's text:
"Upon finding the boat of human birth now, cross the great river of suffering. O fool, there is no time to sleep, for this boat is hard to catch again."
When shall I encounter the extremely rare appearance of the Tathagata, faith, human existence and the ability to practice virtue,
Health , daily sustenance, and lack of adversity? life is momentary and deceptive; and the body is as if on loan.
With such behavior on my part, a human state is certainly not obtained again. When a human state is not achieved, there is only vice. When a human state is not achieved, there is only vice and how could there be blessing?
If I do not perform virtue even when I am capable of it, what then shall I do when fully dazed by the sufferings of miserable states of existence
For one who does not perform virtue but accumulates sin, even the expression "favorable state of existence" will be lost for a thousand million eons.
Therefore, the Blessed One (Buddha) stated that human existence is extremely hard to obtain, like a turtle's head emerging into the ring of a yoke on a vast ocean.
The text goes on and on. Too lazy to type the rest. I'll leave you with one of my favorite lines:
"Enemies such as craving and hatred are without arms, legs and so on. They are neither courageous nor wise. How is it that they have enslaved me? "
-If you are a Buddhist and accept certain Buddhist ideas and thoughts then the above may help answer your question.