We all experience failure from time-to-time and it is how we learn from these experiences that aid to our overall development. I am frequently asked by parents "how do I prevent (insert crisis) from happening to my child?" This is a legitimate question and depending on what the parent is trying to prevent from happening a reasonable one. But, collectively as adults it is important to realize that a child's failure to meet a goal is an opportunity for them to develop the skills needed to achieve success later in life.
Here is a great article that outlines some ways parents and adults can support children through the hard times, so the child can become the driver of their life. The article is written by former American Psychological Association (APA) president Alan Kazdin, Ph.D