What happens to when the desire to live dies

You may be good in solving your problem, and seems you want to do that on your own.

However, it seems your goals and not being able to achieve those has a lot to do with it.

Yes it matters what goals are set.

Setting your goals to match your abilities will never make you feel disappointed.
**
**If
the problem is not having any more goals, since all have already been achieved, then this cannot be true.

There are always something to struggle for.

Or always some new goals to be made to keep going on with life.

Please remember:

Just as there is always something to die for (figuratively speaking), there is always something to live for.