Your past failures are directly related to your future success. Without them, you may not be motivated enough to reach your goals. Athletes face defeat often throughout their careers but don’t let it get them down. Instead, they let it drive them to success. A 2015 study in which the researchers interviewed Olympic gold medalists found that many of those athletes considered setbacks essential to their gold medal wins.

Failure is just as essential to your career, no matter what your discipline. As long as you have the right attitude and view your failures as learning experiences, you can use them to push forward and achieve success.

Here are seven lessons that the world’s top athletes can teach you about failure.

3. Stay positive.

In 2015, tennis star Serena Williams lost a big match at the U.S. Open to Roberta Vinci. Many considered Williams's loss to be one of the biggest upsets in tennis history, but the player herself didn’t let the criticism get to her. Instead, she saw the positives in it and used her loss as motivation to improve.

Speaking to theLos Angeles Times,Williams said, “If you know anything about me, I hate to lose. I've always said I hate losing more than I like winning, so that drives me to be the best that I can be.”

Looking at failure in a positive light will help you grow. Instead of letting failure defeat you, you can learn from it and improve.

4. Believe in yourself.

Boxing champion Muhammad Ali’s road to success wasn’t devoid of setbacks. In the early days of boxing, experts used a series of measurements to assess a boxer’s skills, and when he was just starting out, Ali failed all of them.

Ali wasn’t a natural fighter, but he still overcame the odds and defeated opponents who outclassed him. The reason was his attitude. He believed he could do it, so he did.

In fact, Ali had a confidence that bordered on arrogance. After defeating Sonny Liston for the first time, Ali said, “I want everyone to bear witness: I am the greatest! I'm the greatest thing that ever lived. I don't have a mark on my face, and I upset Sonny Liston, and I just turned 22 years old. I must be the greatest.” This quote and the fight were described in Dave Kindred's book,“Sound and Fury: Two Powerful Lives, One Fateful Friendship.

The message here is, not everyone is going to believe in you. That’s why you must have faith in yourself. You must learn to rely on yourself to reach your goals, no matter what challenges you encounter.

In Robert Goldman and Stephen Papson's book, Nike Culture: The Sign of the Swoosh,Jordan is quoted as having said, “I've missed over 9,000 shots in my career. I've lost almost 300 games. Twenty-six times I've been trusted to take the game-winning shot and missed. I've failed over and over and over again in my life. And that is why I succeed.”

Let your failure drive you in your career. Use every setback as motivation to do better in the future.

6. Learn from your mistakes.

Baseball legend Babe Ruth holds the third-highest home run record and is known as one of the greatest players of all time. But he also once held the record for the most strikeouts. His success may overshadow his failures, but without them he may not have achieved anything.

Robert L. Sutton, in his book, Weird Ideas That Work, quotes Ruth as having said, “Every strike brings me closer to the next home run.”

Just as Ruth’s failures led him to success, so should yours. Take the opportunity to assess how you can improve. Take what you’ve learned and apply it to your future endeavors.

7. Know when to change direction.

Success in one area doesn’t always transfer to another. Hockey player Wayne Gretzky learned this lesson when he tried his hand at coaching. He discovered that his talent on the ice didn’t translate to talent behind the bench, and his team, the Phoenix Coyotes, struggled.