When Roger Federer hoisted the Wimbledon trophy last week, he not only became the first man to win Wimbledon eight times, he also extended his record to 19 Grand Slam titles. This is par for the course for the Swiss superstar this year; he has so far won two Grand Slam titles and moved up to number three in the world.

It wasn’t too long ago, though, that he (and the rest of the world) thought his tennis career was coming to an end. Illness and a nagging knee injury had forced Federer away from the sport for nearly a year, making his 2017 resurgence even more remarkable.

As it turns out, there are some things we can learn from the master’s recent success. Here are five career lessons from Roger Federer’s comeback.

Take care of yourself

After a semi-final loss at the 2016 Wimbledon, Federer decided to take a few months off to nurse his injured knee. During the time off, he focused on taking care of himself, allowing his body to heal properly. He also took the time to honestly re-evaluate his career and ambitions. Did he want to continue? Once he decided there was still a lot of tennis left in him, he redoubled his efforts, practicing and training until he felt he was 100% fit – mentally and physically. Only then was he ready to make his comeback.

“To have had this six month lay-off I feel rejuvenated, refreshed. Maybe mentally I needed this rest more than I thought. I tried to look at the big picture,” Federer told ABC News.

Just like a professional athlete, you too can experience burn out. Whether you are over-stressed at work, or just need time to re-evaluate your career, it’s important to take a step back every now and again. Just like Federer, you may find that after some time off, you’ll feel rejuvenated and ready for a comeback of your own. Or, you might realize that it’s time to start looking for something new.

Change your game

Federer didn’t just take time off to recover, he also took time off to give his game a bit of a makeover. After his knee injury, Federer knew he would have to find a slightly different style of play to compete against the likes of Nadal and Djokovic. He worked on being more aggressive with his backhand and return of serve, and started to serve and volley even more then he did before his break. This more powerful style of play immediately paid off, creating shorter points that have helped him avoid injury, and helping him beat players that he has struggled against in the past.

Similarly, if you’re in a rut at work, maybe you need to start taking a different approach? Just like Federer did with his on-court game, changing your work habits or the way you interact with co-workers can often lead to different results. Be honest with yourself, and try to identify your strengths and weaknesses on the job. Once you have a sense of how you can improve, come up with a game plan and give it a shot.

Have confidence in your abilities

Federer always believed he could come back. At least, that’s what he told ESPN. He might not have known that he was going to win Grand Slams again, but his confidence at least allowed him to take such a long leave of absence and come back stronger than ever before. Without that self-belief, he might have simply retired.

Similarly, to be successful in your career, and to make difficult career changes, you need to believe in your abilities. Apart from improving your performance on the job, this can also be a powerful tool for your career development. In fact, according to the Journal of Personality and Social Psychology, those who appeared more confident achieved higher status in social and work environments than their peers.

Surround yourself with a positive support group

Roger Federer might be confident, but he says that he also leaned heavily on friends and family during his break from tennis. He asked his support group if they believed in him, and the answer was always the same: “They said that they thought if you’re 100 per cent healthy, and you’re prepared, you’re eager to play, then anything’s possible.”

By surrounding himself with people who believed in him, he could stay on course and see out his rehabilitation and training. You might not be a champion tennis player, but it’s still important to surround yourself with a positive support group. Your group of friends, family, and co-workers will directly affect your resilience, determination, and ability to handle stress. The right support group can also help further your career. According to an article in Time, if you surround yourself with positive, hard-working people, those traits will start to rub off on you.

Understand there will be ups and downs 

Federer told ESPN that his comeback has been, “a tough road at times. But that is how it’s supposed to be.”

When he first came back, he had success right away by winning the Australian Open. In the very next tournament he played, though, he lost in the second round. Instead of getting down on himself after this stumble, Federer just focused on the next task at hand.

This is an important lesson for just about anyone. Your career isn’t going to be all sunshine and rainbows. There will be challenges to work through, there will be failed projects and tough decisions to make. But if you continue to work hard, learn from mistakes, and be willing to accept challenges, you too will find success.

After his injury, Roger Federer could have easily quit tennis as one of the greatest players to ever play the game, but he wasn’t ready to say goodbye. Instead, he took time to rest and recover, tweaked his game to play to his strengths (and changing body), and never stopped believing in himself.