Tim Cooks speech is about finding purpose in life and how he did it, he wants to help and motivate the students by giving them his advices and experiences, to prepare them for their future.
He wants the graduating students to know how important the mindset is, and that they need to believe in themselves throughout their life.
This makes him feel more trustworthy and honest, about the stuff he says throughout the whole speech. He wants to help the students; he does this by talking about some of his own experiences.
He wants them to save some of the time in their lives, that he spend trying to figure out what to do and where to go after graduating, if they don’t know yet.2 He does this by talking about his own time in high school, where he didn’t know where he wanted to go and didn’t know his purpose in life.
And this also makes them feel more comfortable, because he is kind of using himself an example, to show them that they can become really successful, even if they don’t know what their purpose is and what they want to do now.