I understand how you feel. Sometimes you privately wonder if life is worth continuing if you only receive these tiny morsels of happiness amidst the chunks of despair and hopelessness.
And to be honest, it's not, but we are conditioned to believe this life actually means something. Some believe it's a trial run for an blissful eternity, and others believe you die alone with a few mourners that eventually forget you existed. You will likely finish your life with a brief mention in the obituary section of your papers (and with newspapers going extinct, your surviving family may decide to just stick with a funeral).
Chances are unless you die in an extraordinary way, your death is not leading the news. Your unremarkable life will be forgotten by a planet that currently entertains 7 billion humans that will be unmoved by your passing. You wouldn't get a mention in the boring history books that your boring teacher forced you to read in high school. You wouldn't have your photo in the yearbook of life. Your life doesn't even warrant a chapter, a paragraph, a sentence. You're not even a parenthesis, or an ellipse. You just...existed by the result of your parents having intercourse.
I guess you could say life is meaningless because by definition it is. But if you already know what your fate is, might as well take something for yourself, right? Death will eventually come for you, why speed up the process when there is an outside chance at you having a change of heart and finding something that makes you more open to the idea of living...the irony is you will probably die when your outlook improves, and you'll wish you had this revelation sooner. Regret is a funny thing.