You don't learn without first making mistakes. Every great inventor "failed" dozens or even hundreds of times before achieving that one great breakthrough.
Without failure we don't have penicillin.
Without failure we don't have plastics.
Even the pacemaker was created by mistake, it was supposed to be some kind of recording device that didn't work right.
If you learn from a mistake, then it's not truly a failure, always remember that.