My former colleague, emeritus professor and senior super-historian (world history) recently wrote an article pointing out that there have been few, very very few, years of recorded history that does not record wars going on. Since there has presumably been faith, some sort of faith, all sorts of faith, throughout recorded history, believers must have been taking wars into account when they have and express faith.
So it would be a matter of generational egocentrism for us to think that we should be or are unique in dreaming up the question about how war and faith can coexist in mind and in the same century: they always have.
Sad to say, often they coexisted because or so that one could invoke God or the gods in the unholy causes of war. So such believers "kept their faith." The vast majority of believers, we must presume, were benumbed, befuddled, puzzled, often grieving, probably prayerful, sometimes reflecting on human folly, on occasion praising the courageous.
War can indded obscure thoughts of the goodness of God and inspire vivid thoughts about the outrageousness of evil. For some it can mean a loss of faith, or self-examination if they never had it. Albert Camus told the Dominicans who admired him in the French Resistance that if he could believe in a God who let the war go on and let babies die, he would - but he could not. He wanted the priests to respect him in his unbelief if their virtues matched and they inspired each other, and he would respect them. War or no war, he kept unbelieving and they kept believing.
Faith is born, love extended, hope magnified in the face of and in spite of human finitude, chance in nature and history, and transience. I keep my faith, or my faith is kept for me, in the face of the same. I have no secret or special techniques for faith-holding: accept a gift as a gift, and ponder, and wonder.