Many years ago I read somewhere and I’m paraphrasing; It’s OK to lose few battles. All that matters is, you win the war. This is a great mindset to have during challenging times.
The greatest military generals have lost battles but won the war. When you face a setback; ask yourself “Am I ready to stand up again and fight till I win?”.