“You've got a lot going for you.”
Your friend isn't feeling confident because he didn't get a job he was applying for. You want to make him feel better by telling him he has a lot of great qualities, so you say this.
You've got a lot going for you.
This phrase means that a person has several positive characteristics, like being smart, attractive, etc.
You usually say this to someone who's feeling bad about themself, or about someone who's had some kind of failure.
He's got a lot going for him.
Why would someone with so much going for him waste it all by dropping out of school?
There are some other phrases which sound similar, but have different meanings:
"You have a lot going on" means that a lot of stuff is happening in someone's life.
"You're going through a lot" means that a lot of difficult stuff is happening to someone.