When Mike Massimino was six years old in Long Island, New York, he saw astronauts as superheroes and held them up on a pedestal. The summer of 1969, he watched wide-eyed on the television as Neil Armstrong and Buzz Aldrin took the first steps on the moon and remembers thinking, “They’re going to be talking about this 500 years in the future.”
He immediately made his mom turn his elephant school play costume into an astronaut for Halloween.
“Neil Armstrong was it,” he tells Fortune. “The space program hit me at a very young age. I’ve always felt it was the most important thing going on in the world.”
More than two decades after watching the first man on the moon—and receiving three rejections from NASA—Massimino served as an astronaut from 1996 until 2014, including during the last mission to the Hubble Space Telescope. His team set records for space walking times, and he’s also played himself on the sitcom The Big Bang Theory.
In many ways, Massimino is an unlikely success story, but he’s also a master class in grit, which he credits for helping him beat the odds. Now, he has a message for others about perseverance. “The one thing I felt like I could control was how hard I tried and not giving up,” he says.
“You can control the effort, not the outcome,” a friend once reminded him.
Grit is the perfect combination of passion and perseverance, ultimately leading people to stay committed to long-term or lofty goals, as explained by psychologist and speaker Angela Duckworth who wrote Grit. As a researcher of the phenomenon, she found grit is a strong predictor of performance, as compared to other common attributes of success like consistency. Beyond career success, grit also improved well-being, and was found to improve people’s sense of life satisfaction, engagement, and happiness, and was even associated with lowering levels of depression.
NASA
As a child fascinated by the undiscovered parts of the universe, Massimino followed the latest in space missions and digested films and books on astronauts like The Right Stuff, where he saw the power of detail-oriented teamwork between the mission control center and space. He dreamt of being on the team. But his wish caught up with him when he realized he lacked the ideal skillset to make it as an astronaut: He was afraid of heights and couldn’t swim. “I could never do what they do,” he says. “I thought I would never fit in.”
The most detrimental setback was his poor eyesight. “That dream, the idea of following my heroes into orbit, had already lived and died a thousand times in my imagination,” he writes in a new book Moonshot, about his career in and out of space.
Given all of Massimino’s barriers to qualify and excel as an astronaut, he worked on paving the way for a different career and landed a desk job at IBM. However, when the Challenger exploded, Massimino decided he wouldn’t wait any longer to pursue his passion.
NASA’s elite program of astronauts introduces a new class every couple of years. If you don’t make it, you won’t be considered again until the next round. Massimino first applied to the program in 1989. Eight months later, he received his rejection letter in the mail. Unsurprised, he began pursuing space research and education, working toward his PhD in engineering at MIT. He applied again two years later for the 1992 astronaut class. He got rejected again but began working in the industry as a research engineer at McDonell Douglas Aerospace in Houston, Texas. Years later, for the class of 1995, Massimino’s application got flagged. The interview process was as extensive as one would imagine, with IQ tests, medical examinations, and numerous lab tests.
Massimino was medically disqualified for something he could not change—not having 20/20 vision. He didn’t stop there. After extensive research, he pursued vision training for nearly a year, having taken advice from others in the space science field, helping his eyes focus more clearly on objects in front of him.
Submitting his fourth application to NASA like a shot in the dark with a note from his eye doctor on his improvements, Massimino got a call. They would let him retake his eye test. He passed.
“Making a decision to give up on my dream after coming so close was unthinkable,” he writes in his book.
You could look at Massimino’s first three applications and conclude he failed. But failure is not something Massimino writes much about in his book. He also says he wasn’t under an illusion, thinking it would all work out perfectly on the first try. He instead carried a belief that if he kept trying, even if he didn’t succeed in the way he intended, it would be okay.
“I felt like if I do these things and try my hardest, it would lead me to a good outcome anyway,” he says.
It’s more about contentment with your current circumstances while not giving up on the chance for more and your passions, no matter the obstacles.
“One in a million is not zero,” he tells Fortune. “I knew that if I gave up, I would always wonder what would have happened.” Not to say that his post as a professor—where he was before and after joining NASA—was a consolation prize. He was happy in his job but kept applying as if he were the six-year-old watching Neil Armstrong’s moonwalk again. During a decade of rejections, he pursued many fulfilling avenues around space travel and engineering while starting a family. But Massimino says it took checking in with himself and being honest about the untapped potential to go the extra mile and take a chance.
“I think it’s trying to be honest with yourself about what really matters to you, and trying to try to give yourself a chance to get there,” he says. “For me, it was just the passion of wanting to do it.”
Massimino also realized, especially during the interview process where he met accomplished astronauts and scientists, that successful people are not the superheroes he once idolized.
“I found that the people at the top of their profession, whatever that means, were also some of the nicest people. Good people are rewarded for being good people. You shouldn’t mistake kindness for weakness,” he says. “I started realizing that maybe it wasn’t as crazy. Maybe I didn’t have the same skill set or experiences as some of the others, but that didn’t mean that I didn’t fit in.”
While Massimino understands the uncontrollable barriers keeping people from pursuing the career of their dreams, his success was less about getting to space and more about trusting himself and not viewing rejection as a personal failure.
“I would have never stopped trying,” he says. “To do this day, I would be submitting an application.”