Despair is the enemy of victory.
In war, if two equal and opposing sides cannot be differentiated by anything other than morale, the sad side loses.
It's the same in spiritual warfare. If you lose the battle for your spirit, if your hope is lost and your optimism shattered, if you read the scriptures and cannot bring yourself to believe them, then you've lost even before the fight has begun.
You can't win if you cease to care. If you stop caring about your marriage, you'll end up divorced. Nobody's marriage is perfect, but if you let the ongoing imperfections lead you into despair, you'll give up and lose the fight for happiness, mutuality, and partnership.
God cannot perform what he wants in your spirit without your openness and cooperation with his spirit. Neither can we expect God to work in our favor if we act with disregard or carelessness toward others, ourselves, or our circumstances.
You have to fight for victory in your outlook, so you can experience victory in your circumstances.
The real question at the end of all this is how do you lift your spirits, boost your morale, and restore your hope?
Three things must be said here. First, hope comes through character (see Romans 5.2-5). You get hope in the midst of suffering because suffering produces perseverance, and perseverance produces character, and character produces hope. If you can keep fighting to keep fighting (that's the perseverance part), you'll grow increasingly resolute (that's the character part), and those two things together (which we might refer to as suffering well) add up to hope because, simply put, you wake up and realize Hey, I haven't lost yet, and I've been fighting for a long time. Maybe there's hope after all!
Secondly, you have to realize hope comes though memory and the application of memory into the future. For example, when you read the scriptures and learn the stories of people who previously put their hope in God you realize that [a] you're not the only person to have fought for hope and [b] if they can persevere then so can you (Romans 15.4). Likewise, when you look back over your life and see the litany of God's faithfulness to you, you become increasingly confident that the same God who showed up to help you before can be trusted to show up and help you once again. Victory yesterday translates into hope for tomorrow.
Finally, hope is rooted in imagination. You have to close your eyes and dream up a better future, one consistent with God's vision for your life, and then work towards bringing that dream into reality. Admittedly, this is the hardest of the three, but it is also the most profitable. Despair is, at the root, all the wrong kinds of imagination. It's when you let your fantasies spoil and become nightmares so that all you can imagine is horrible and wrong. Take control over your imagination, fill your mind with wonder and beauty and adventure and meaning, and start healthy production back at the fantasy-factory.
Of course, there's good biblical language for this kind of sanctified imagination. In the scriptures they call it visions and dreams, and when the prophets spoke about the visions God gave them for the people, the net result was always hope.
Hope does not disappoint.