What should I do if I feel like a total failure of a husband?
Whoa, are you sure it is even true that you're a failure in the first place?
Most of the point is true. I've ruined all my relationships
I'm sorry you're not in a good spot right now, but it's pointless to continue moping about what you did in the past. You don't need to be this critical of yourself, and instead of that you should strive to be a better husband and work for a better relationship.
I agree. I focus too much on the past, I need to look towards the future.
Good, moving forward is unironically the only way forward and the best way to move on. You shouldn't be so hard on yourself or you'll never improve as a person.