What to do when you have no hopes left? If my experience means anything, I'd say there is little to do, if not to stay strong in your belief that this is a temporary state. At times, I feel like a bag of meat with absolutely no purpose. I look at myself in a mirror and I simply can't believe that the person staring at me is supposed to be me, just like a complete sense of disconnection. Of course, gender dysphoria doesn't help with this part.
Eventually, what I have come to realize is that my mental state as got a lot to do with my physical state. For example, I know that a bad night of sleep will have me depressed for the next day. So I have to think in advance, when it goes well, and remember that I am fragile with this and that I need my sleep. Once the crisis is there, if it is strong enough, I believe that there is little that you can do but hold on until the storm has passed. But once the sunshine is back, and it will be back, use what happened during the storm to know yourself better in order to prevent an other one from happening. Of course, you can't always control what's happening to you, but there are certainly a couple of things you can do to help yourself. Some people (like me...) deliberately do the things that makes them depressed. Why? Maybe that is something to dig for. When you realize that you are punishing yourself by getting into these situations where you feel depressed, be it trough lack of sleep, alcohol abuse, voluntary isolation, by hurting the people around you or by going around with people who hurt you (I don't say that you do any of these things, just that this is a pattern that tends to be common) it is time for you to see your worth.
Of course we are nothing but meat bags, we Are biological machines. But we also have to capacity to feel and love and reason and dream. This should be more then enough to realize that we deserve to be happy. Feeling bad? Yeah, that happens a lot. But as long as you have hopes that happiness will come back and as long as you learn from your mistakes, even if it takes time, you can make the life you want for yourself.