Another explanation of Chazal’s statement that “One who wants to live should kill himself” is that one who wants to live real life, i.e. life in the World to Come, should kill himself in this world to do Torah and Avodah.
In truth, the intention and purpose of life in this world is to please Hashem. This being the case, every pious person should pray for this, and when a person desires or asks for long life from Hashem, he should not ask in order to be present at his children’s weddings or to see his descendants or for other such reasons, for all this is nothing. On the contrary, one hour of pleasure in the World to Come is finer than all of the life in this world. One should, therefore, wish for life only in order to be able to serve one’s Creator and give pleasure in front of His Glorious Throne. One who thinks profoundly about this will try very hard to spend all of his life in the service of Hashem Yisbarach, and all of his actions will be for the sake of G-d. He will be very careful not to waste the time that he is alive, because it is more valuable than anything else. And for this reason it is also incumbent on every person to look after his health and to be very careful about his life, so that he does not come to lose the abundance of goodness (in the next world) that he could acquire in one hour on this world. A person who does not guard himself from any bad thing, is guilty with his life and will have to give a full account for every bit of time he caused himself to lose or waste.