The harder you work the luckier you get.

Cuba Gooding Jr. shot to fame in the 90s when he starred in blockbusters like Boyz n the Hood, A Few Good Men, Jerry Maguire. Still, after winning an Academy Award in 1997, his career began a downward spiral that included highly criticized roles in films like Chill Factor, Boat Trip, Norbit and Daddy Day Camp. But now, Gooding Jr. is directing a new film, Louisiana Caviar, and attributes some of those bad jobs to what he’s able to accomplish now.

According to the New York Post, Gooding Jr. recently spoke at a Cinema Society screening of his new film and told the crowd that it took starring in some “utter trash” before learning the craft of directing. “An actor does a role in a film . . . he goes into that screening a year later and he either goes, ‘Yeah, “Jerry Maguire,” ’ or ‘What the f - - k was that?’ ” he said, according to the New York Post. “It’s more the latter response . . . because the director and [actor] did not connect. The director has to be the captain of the ship, so it was always my endgame.”

Plenty of other celebs and CEOs have also had not-so-glamorous jobs they made the most of — pulling valuable lessons from them. Channing Tatum was a stripper at the age of 19 — a job he loathed, telling Entertainment Tonight, “For what I was doing for the dollar, not enough of the dollars.” But he used that experience to land and inform his role in the breakout hit Magic Mike. And, Jennifer Aniston spent her early days in LA as a telemarketer selling vacation timeshares — which no doubt was a primer for the rejections she’d sometimes witness in Hollywood.

Those crappy jobs also have helped CEOs like Indra Nooyi. Before becoming the CEO of PepsiCo, she worked as a receptionist to earn money. Fast Company reported that Nooyi credits early career experiences like that one with teaching her ways of thinking that helped shape the way she leads a giant corporation. She decided to work the graveyard shift which paid fifty cents more per hour so that she could buy a dress for her first job interview. Attending classes during the day and working at night helped define her impressive work ethic — which has continued to suit her well throughout her career.

Those crappy jobs are something all of us with likely experience, says career happiness strategist and creator of the 1-Year Career, Baily Hancock. “What’s important is to make the most of your time while you’re figuring out your next move,” she says.

Teague Simoncic, a career coach with Ama La Vida tells Moneyish, “Just because you’re stuck in a role that doesn’t thrill you doesn’t mean there aren’t ways to use this time as a learning opportunity. Take advantage of the resources available to you, whether that’s development seminars, free trainings, or mentorship from industry experts.” She also suggests using the opportunity to meet people in your field. “These days, a good amount of job searching success comes from who you know. It’s hard to predict which connections you make will have a meaningful impact down the line, so make an effort to introduce yourself to the people you work with on all levels — you never know where that will take you,” says Simoncic.