This happen in the manga, the Kakashi Giaden series. In Kakashi’s Gaiden, it’s revealed that Kakashi was the fourth Hokage’s former student, along with Uchiha Obito and a girl named Rin.
In Kakashi’s gaiden, it’s a story about Kakashi and the mystery behind how he got his sharingan.
Kakashi was similar to Sasuke in his youths. He even said, ‘Ninja’s who doesn’t follow the rules are trash’ to Obito. Later though, it will be revealed that Kakashi’s father died because saving his comrades’ lives instead of finishing the mission. Kakashi’s father was blamed by the village and even the friend that he saved. So Kakashi now follows all the rules, and his first priority is his mission.
When a mission goes wrong and Rin was captured by the enemy, Kakashi was still persistent to continue the mission and leave Rin behind, but it was Obito who said to Kakashi that Ninja’s who doesn’t follow the rules are trash . . . but ninja’s who abandoned their friends are lower than trash. So then Kakashi and Obito decided to save Rin.
When they tried to save Rin, his left eye got blinded by the enemy, and they were also trapped by falling rocks that the enemy caused and the falling rocks fell on top of Obito’s right side of his body. Kakashi tried desperately to save Obito, but it was no use.
Obito said that he didn’t give Kakashi anything when Kakashi became a Jounin (yes he was already a Jounin at that time), and Obito decided to give Kakashi his undamaged sharingan with the help of Rin’s medical jutsu.
Since then, Kakashi’s been living in guilt about Obito’s death, and his priority now is as we know it, team work and friendship.
Kakashi’s always late when he has an appointment with team seven because he spent most of his time at the memorial beside the training ground. Obito’s name’s carved here, so Kakashi often comes here to think about how foolish he was when he was young and that’s why he always late when he has an appointment with team seven.