If you pay attention to what movies and television tell us, being in your 20s is supposed to be the best time of your life. But for many young professionals, questions about money, relationships and work can make things feel pretty complicated — and overwhelming. According to research by psychologists of the University of Greenwich and University of London, nearly 90 percent of millennials say they experienced an intense period of confusion and depression during this life stage. It's helpful to remember that some of the world's richest, most successful people have gone their own quarter life crises. Here are five successful people who struggled in their 20s, and the key lessons they took from the experience: 1. Mark Cuban Before Cuban became a billionaire entrepreneur, investor on ABC's "Shark Tank" or owner of the Dallas Mavericks, he was just another young man struggling to make it in business. He was living with five other guys in a three-bedroom apartment, working at a company that sold PC software.

Mark Cuban, billionaire owner of the National Basketball Association's (NBA) Dallas Mavericks basketball team, speaks at the 2017 South By Southwest (SXSW) Interactive Festival at the Austin Convention Center in Austin, Texas, U.S., on Sunday, March 12, 2017. David Paul Morris | Bloomberg | Getty Images

In his book "How to Win at the Sport of Business," Cuban describes being fired for "not telling anyone [he] was going to lunch to try to close a deal." But he learned from that setback. Besides encouraging him to become an entrepreneur and his own boss, it shaped his leadership style. "[My former boss] was my mentor, but not in the way you'd expect," Cuban writes. "Even now I think back to things he did, and I do the opposite." His best advice to young professionals? "Never stop learning," he says. "Never stop grinding. Never stop loving every single minute of your life." 2. Elon Musk The Tesla and SpaceX CEO faced a challenging time when he dropped out of Stanford University, where he had planned to pursue a Ph.D. in applied physics and materials science, after just two days. "It got to the start of the quarter at Stanford, so I had to make a decision, and I decided to go on deferment," he tells entrepreneur interview series Foundation. "I said I'd probably be back in six months, and [the chairman of the department] said he was probably never going to hear from me again. And he was correct."

Elon Musk, chairman and chief executive officer of Tesla Motors Inc. David Paul Morris | Bloomberg | Getty Images

He slept on the floor of an office, showered at a nearby YMCA and struggled to make ends meet. Still, he didn't abandon his entrepreneurial goals. He built Zip2, an online software company that allowed newspapers to publish their content online, and the big career risk soon paid off. The company was a success and Compaq bought it a deal valued at about $300 million. The experience taught him to not fear risks and to work harder than anybody else out there. 3. J.K. Rowling In her 20s, following the death of her mother, Rowling moved to Portugal and became an English teacher. There she met and married her husband. She suffered a miscarriage and later gave birth to a daughter, Jessica. But Rowling's marriage soon fell apart.

J.K. Rowling Getty Images

She moved back to the U.K, poor and severely depressed. "We're talking suicidal thoughts here, we're not talking, 'I'm a little bit miserable,'" Rowling tells Britain's Sunday Times. "Mid-twenties life circumstances were poor, and I really plummeted." She took a job teaching in Edinburgh, Scotland, and came up with the idea of a school for wizards and a character named Harry Potter. She developed the idea further, writing in every spare moment she had. After receiving "loads" of rejections from book publishers, she finally landed a deal for "Harry Potter and the Sorcerer's Stone." 4. Oprah Winfrey When Winfrey was 23, she was demoted from her job at Baltimore's WJZ-TV nightly news to a less-coveted morning spot.

Oprah Winfrey Photo by Jemal Countess

"I had no idea what I was in for or that this was going to be the greatest growing period of my adult life," Winfrey said. "It shook me to my very core, and I didn't even know at the time that I was being shaken." It was a key turning point that led Winfrey to becoming the TV host the world knows her as today. 5. Steve Jobs Before Jobs started building Apple in a garage, he was a young adult looking for meaning in life. After one semester at Reed College, Jobs dropped out. He traveled to India to find purpose in his life, and experimented with psychedelic drugs.

Steve Jobs, co-founder of Apple Justin Sullivan | Getty Images

The period of uncertainty helped guide Jobs to his "aha" moment, where, along with Apple co-founder Steve Wozniak, he realized he could build a world-changing computer.

How to overcome your own quarter-life crisis:

1. Look at what has inspired you in the past

Putting pen to paper could help you build your network, according to a best-selling author and career expert. Kelvin Murray/Getty Images

Adam Poswolsky , who was broke and unemployed at 27, offers a key lesson in his book "The Quarter-Life Breakthrough." Poswolsky turned his crisis into a valuable career as a writer, speaker and millennial career expert, and says that looking at what has made you happy in the past could point in the right direction for your next career move. Examine what moments in your past defined and inspired you, he suggests. "Being able to articulate the defining moments that have shaped your life will help you get closer to realizing who you are and what your breakthrough is all about," he says. 2. Start a project that inspires you

Hero Images | Getty Images

If you're frustrated and not sure what you should be doing with your life, forget trying to find your "one passion," says Jenny Blake, the co-creator of Google's career development program and author of "PIVOT: The Only Move That Matters Is Your Next One." "For some, the pressure to define a purpose or mission statement is stifling and causes much unnecessary angst," she writes. "I recommend people follow a project-based purpose," Blake tells CNBC. Having a "project-based purpose" means finding initiatives at work that excite you and make you feel like you're having an impact, she says. Alternatively, you could start a side project that will teach you valuable skills and give you a way to explore your interests. 3. Focus more on building healthy relationships and cultivating hobbies

Sean Drakes/LatinContent/Getty Images

What you do outside of work is incredibly important to your career, Blake says. That's why she recommends everyone write his or her own formula for happiness. The exercise helps people see their life and career more holistically, she says. "What are the activities," she asks, "where if you were to get these done in a given day or week, takes you 80 percent of the way toward feeling great?" Once you have that list, write your ideal formula for happiness. For example, it could look like this: Happiness = Seeing a friend once a week + working out two times a week + going to bed by 10 p.m. + devoting 10 minutes each day to my side project. 4. Reach out to people who have the job you want

New Harvard University research examined over 300 online and in-person conversations. Willie B. Thomas