Well, it all starts with the Uchiha clan's dissatisfaction with Konoha. They were planning to revolt. Itachi, as a very perceptive and intelligent shinobi, knew this. Instead of allowing a violent coup, he made the heart - wrenching decision to kill the clan himself to protect the village. This led to his life as a pariah in Sasuke's eyes. Then, he joined the Akatsuki. There, he had to deal with various dangerous characters. He was constantly on a tightrope, trying to balance his role as an Akatsuki member and his loyalty to Konoha. His interactions with Sasuke over the years were also key. He would show up and taunt Sasuke in a way to make him stronger. And finally, when they met for the last time, Itachi disclosed all the secrets behind his actions, which completely changed Sasuke's perception of him.
First, there was the unrest within the Uchiha clan which led to their plan for a coup against Konoha. Itachi, being a shinobi loyal to the village, was given the task of stopping it. So he carried out the massacre of his own clan. After that, he joined the Akatsuki, a criminal organization. But he was actually a double agent for Konoha. He spied on the Akatsuki's activities. And finally, the crucial event was his face - off with Sasuke. During this encounter, he revealed the truth about his actions to Sasuke.