Banging the piano lid shut in a crescendo of rage 10 minutes after practicing new scales. Crumpling up the algebra worksheet into a small ball of frustration. These are the times that try parents’ souls — those tearful and tempestuous moments when our children simply give up.

If these episodes are hard for parents to witness, consider how our children feel. They are trying something new and difficult and — in their minds — failing. In truth, this is an ideal teachable moment, when we can help our children understand that, no matter how new or difficult, challenges are achieved through patience, practice, and effort.

“Perseverance, or work ethic, is one of the most highly correlated traits of success,” says child educational consultant Michele Borba, the author of The Big Book of Parenting Solutions. Persistence is something children need to succeed in school and life. A 2007 paper from the Journal of Personality and Social Psychology found the ability to persevere may be as essential as talent or IQ to succeed. The good news? Persistence is a trait that can be taught and learned. It’s just a matter of knowing how to help your children — and not giving up on them when they give up on themselves.

Talk about it

Preteens and teenagers benefit from regularly hearing about persistence. So teach them different ways to talk about problem-solving: “I won’t quit,” “I can do it,” and “It’s always hardest the first time, but it will get easier.” Borba also suggests coming up with a household “stick with it” mantra, explaining that families that maintain an overall attitude of “We can do it” tend to face obstacles and mistakes with grace and ingenuity. Some favorites: “Mistakes don’t get us down” and “The family that doesn’t quit!” Finally, tell stories either from your own life or ask your school librarian to recommend biographies about people who’ve prevailed and succeeded despite the odds.

Resist rescuing

When we see our kids having a hard time because they aren’t succeeding, it’s tempting to jump in to make it all better. But remember: We learn by trial and error. By giving them a chance to fail, we also give them the pleasure of succeeding on their own. The next time your teens or tweens have a problem and ask you to solve it, don’t. Instead, sit down and ask them to think of a solution. This gives your children time to cool down and teaches valuable problem-solving skills. And while it’s tempting, when playing games — be it Ping-Pong or Scrabble — refrain from letting children win just because they’ll be unhappy if they don’t. Playing fair and square teaches the important life lesson that, in games as in life, sometimes you’re going to fail before you win.

Nurture a hobby

Children who have a passion learn the pleasure of practicing and improving at something they love, says Borba. Give them books on the subject. Encourage them to join a club or team that’s aligned with their interests. Not only are they learning firsthand the value of mastering something through effort, they may also be preparing for their adult vocation.

Watch out for the “I can’t do it” triggers

Do your children seem to blow up at a certain time of day? Often, says Borba, older kids get frustrated and give up at a task simply because they are tired, hungry, or just need some time to unwind after a long day at school. So make sure your tweens or teens are well fed, get enough sleep, and have a chance to relax before settling down to a chore or homework. By explaining that they’re strengthening their minds and bodies to be ready for the task at hand, kids will learn to fortify themselves before turning to a challenge.

Remember: Older kids sometimes blow up when they can’t get something right. Avoid recrimination (“I told you this would be hard”) or reacting with your own, sometimes justifiable, anger (“Don’t yell at me just because you are having trouble studying for your history test!”). If you lose your cool, walk away for a moment. Also, suggest your children take a break, then return after calming down.

Push them … just a little

This is one of the trickiest but most essential ways to work out children’s persistence muscles. It’s tempting for older kids who do something well to stay in their comfort zone and never venturing beyond that point. Push them to try just a little bit harder next time. For this purpose, kitchen timers are a parent’s best friend. So if your children practiced their music for 10 minutes this week, set the timer for 15 minutes the following week. Don’t forget to offer some words of encouragement: “You did great practicing 10 minutes. Let’s see if we can make this a little more challenging for you.”

But don’t make the expectations too great

While you do want to encourage kids to try harder, don’t make your expectations exceed their ability to succeed. If you see your children failing more often than not and feeling the sting of disappointment every time, ask yourself if you are setting the bar too high. Is the soccer team too advanced for your children? Are you so much better at Scrabble that your kids can never win? If the answer is yes, it’s time to lower the bar so your children experience just the right challenge.

Remind them of their successes

“I’ll never be able to do it!” Chances are you’ve heard your children utter this mournful cry of defeat. At times like these, make kids the hero of a story. Remind them of the triumphal times they had trouble doing well at something but kept their eyes on the goal and succeeded. “Remember when you were terrified of starting at a new school but braved it out and ended up loving it?” This kind of pep talk is often just what kids need to try, try again. And when your children hang in there, point it out. “You stuck with your science project even though it was hard. You should be really proud.”