It's not always easy. Sooner or later each of us will come to a point in life where nothing works out like it should.
It's important not to lose hope in such moments. Look ahead and try to see the positive things in life. Ask yourself just at the beginning of the day what you are grateful for. Think of your family, for example. Be grateful that you are well or that you have another chance to change your life on this day. Try to oversee the negative.
I know that's easier said than done, but over time you'll get better in positive thinking. Your brain is a muscle that can get stronger day by day. You just have to be disciplined. At some point your brain will identify almost any negative thought like a firewall and turn it into something positive.
For example when I sometimes doubt myself it is increasingly recognized by me. Now I have the opportunity to reshape this negative thought. Alone the conscious recognition of these thoughts can already be a guidepost. Now you can constructively work on this doubt.
Sometimes you feel like a shot deer. That's what I wanted to say with this picture. But as bad as you may be what's in it for you if you give up?