"Encouragement" such as "you can do anything you put your mind to" implies fault for anything not yet accomplished and can bring shame along with pressure. It is important to acknowledge what someone has already accomplished, and to acknowledge setbacks *as setbacks*. Being frank about misses shows you "get it" and are connected with their experience. It also makes your praise, confidence, and congratulations more powerful because you have shown that you mean those things when you say them.