Something you might find helpful....a mental illness is not a death sentence. Many are recoverable with proper care. If something is weighing on you to that point that normal activities in life are very hard, then I suggest start with talking to someone. Maybe your family Doc? And maybe here!
Caffeine might also be that you are treating yourself. Why do you think people smoke? It isnt just that the smoke is relaxing. It is also because it is an excuse to take a break from life, reflect and feel comfortable. It becomes like a silent best friend. The same could be true for coffee in your case.
Do you give yourself a break now and then? A chance to relax? Is this normally when you have a cup of Coffee? Just a thought, maybe I am way off, but the more you share here, the more support you will have here. So share all you like ok? Feel welcome here.
With a hug
If you keep on doing what you've always done,
You will keep on being who you've always been.