Our perceptions are indeed our reality. This applies not only to our awareness of events in the world around us but also to the meaning we assign to those events. Nowhere is this more meaningful than in how it affects our beliefs about ourselves and our capabilities.
Carol Dweck, PhD of Stanford University has conducted multiple studies focused on this exact topic. She explains that people can see the world from either a "fixed" mindset or a "growth" mindset. Those with a fixed mindset suffer from what Dr. Dweck calls the "Tyranny of Now". In this state the individual focuses on a result at a point in time and believes that they will continue to have the same capabilities and likely achieve the same outcomes in similar circumstances in the future. On the other hand, someone with a growth mindset simply believes they have not achieved success, yet. The use of "yet" is enormously powerful in this case because it gives them a pathway to the future.
Further, kids in one study were told that after difficulty or failure, their brain's neurons can form new, stronger connections which will make them smarter over time. Kids who internalized this concept showed a large increase in their grades vs. others who did not learn this idea.
The key to nurturing people into a growth mindset is to praise their approach and sustained effort to learn. It's therefore important to encourage others, your kids, even yourself, to consider that any difficulty or setback is simply information that you just need to make some changes and try again.