Not meeting your goal does not mean you failed. Often you made progress. Too often we believe that it's a loss if we didn't hit our original target–even if our work pushed us closer to that goal. We made some gains, but we didn't hit that goal we had set. Thus we end up frustrated and upset.
Success is not merely reaching your destination. It is also when you improve your position. Imagine wanting to drive 3,000 miles, but the car runs out of gas at mile 1,500. You've gotten halfway there. You can be angry that you're not at mile 3,000, or you can be happy that you're halfway there.
If we can learn to love the process and appreciate the gains, it's easier to get up and keep pushing toward hitting the target we set.