"There is no failure, only feedback." — Naval Ravikant
This is a difficult mentality to adopt, but ultimately a game of perspective.
Operating with the assumption that you'll get something right the first time you try is not only unrealistic, but incredibly counterproductive.
In any endeavor, failure is the thing that points us toward the next iteration.
All progress is supported by incremental failure.