As someone who has been through a similar phase (during my Ph.D.) that lasted years, and who has seen close friends go through the same, I hope the following will help.
During this phase, I found myself unable to step back from the little failures and hiccups I hit along the way. I was unable to see the big picture or look at the effect of small efforts made in the long term. As a result, whenever something would go wrong or even appear to go wrong on a goal I had set out to do, it would immediately trigger a flood of gated emotions that I had held back to start pursuing that goal in the first place.
The only way I managed to dig myself slowly out of my state of mind was to force 'small wins' on a day-to-day basis.
Go to the gym. Get out of bed and finish a morning routine. Read two to five pages of a book before bedtime. Try cooking a new recipe on a Sunday afternoon. Have a date-night with your spouse to reconnect. And so on. I started by forcing similar small wins for a month and found myself gaining the confidence to push towards bigger goals, except with a significantly better outlook this time around.
My advice would be to set up the smallest goals you can, and then go accomplish them. Remove the possibility of failure from the equation. Start with just one and go sequentially in the beginning. Specifically, activities like sports and exercise have built-in metrics that let you see clear progress over time. The confidence that comes from these small wins provides the foundation to push yourself a little farther as time goes on. Confidence breeds confidence. Start with one aspect of your life (e.g. health, or relationship with spouse) and slowly expand into the other parts of your life. When things go wrong, just re-think the goal; break it down further or simplify and try again.
From my own personal experience, a surefire way to fail is to initially set yourself up with goals that require significant time or patience. With an inability to step back and see that failure in the short term doesn't imply failure in the long term, it risks spiraling you back into old patterns that only provide negative reinforcement.
Hope this helps.