This is the advice Apple CEO Tim Cook would give his younger self — and it came from Steve Jobs

Tim Cook and Steve Jobs in 2007
Getty Images

As the CEO of the world's most valuable company (Apple currently boasts a market value of nearly $870 billion), Tim Cook is more than qualified to offer life advice. But what advice would Cook give to his younger self?

"I would tell myself that the joy is in the journey," Cook says, according to an excerpt of an interview with MSNBC's Chris Hayes and Recode's Kara Swisher that is set to air Friday, April 6.

"The truth is we all have the same purpose. And, we should all quit looking," Cook told the crowd at Chicago's Lane Technical College Prep High School.

"Our purpose is to serve humanity."

He says it's something he learned from his late boss, Steve Jobs.

"I went through a period of time that I was rudderless, where I thought I should be looking for my purpose," he said. "I looked under every sheet, behind every door, and everywhere, and I couldn't find it. I thought, 'Oh my God, there's something wrong with me. I can't find it.'"

Cook says he finally came around after he met Steve Jobs and joined Apple in 1998, noting that he'd "found a company that believed ... its job was to serve humanity."

During the interview, Cook went on to advise high school students to ask the question, "What will be my gift?" every day.

"Most of your gifts will never be money," he said. "They will be a gift of yourself and your passion — your way of changing the world, improving the world for other people."

Here's how Apple CEO Tim Cook faces the big issues
Here's how Apple CEO Tim Cook faces the big issues

Cook has offered similar advice to students in the past, telling college graduates at Scotland's University of Glasgow last year "to find the intersection of doing something you're passionate about and at the same time something that is in the service of other people."

The 57-year-old Cook, who took over from Steve Jobs as Apple's CEO in 2011 and received about $12.8 million in compensation last year, said he wishes he'd come to that service-oriented realization earlier in his own life.

"I wish somebody would have hit me over the head with it earlier," he said. "Steve [Jobs] hit me over the head with it. It just took a little while."

Don't Miss:

A high schooler interviewed Apple CEO Tim Cook — and he told her his secret to success

Apple CEO Tim Cook 'deeply offended' by 'DACA situation'

Apple CEO Tim Cook: Don't let your kids use social media

Like this story? Like CNBC Make It on Facebook!

Tim Cook says Apple founder Steve Jobs had this unique gift
Tim Cook says Apple founder Steve Jobs had this unique gift