If you’re frustrated, you’re learning.
Whenever I’m working on something that’s really difficult, there will invariably be a time when it gets so frustrating that I highly consider quitting (and, in some cases, have actually done so).
But in retrospect, I’ve always found that times of great frustration have also represented periods of significant learning. Indeed, when I look back at jobs I’ve done and projects I’ve completed that truly felt impossible at the time, I almost always think, “You know, that would be fairly easy now.” And that’s because I was really learning far more at the time than I realized.
So whenever I get frustrated, I tell myself “I’m learning,” which is almost always enough to keep myself from quitting.
(I should add that this idea is essentially the same sentiment as the far-more-poetic saying that “It’s always darkest before the dawn.”)