Mistakes happen, esp. as we learn new skills or discover new knowledge in school and other places. So, let's take the opportunity to figure out what went wrong.
Do you want to ace a test? Just tell a friend what you've learned about the subject of the test. This will help crystallize the memory of that content.
Parents, coaches, and teachers can encourage kids to develop a growth mindset, as opposed to a fixed one. This will help them keep learning throughout life.