Vision was created as a result of the failed Ultron Project. After Ultron became sentient, he created a body made of Vibranium with the help of Helen Cho. This body was declared to be the perfect form for Ultron and powered by the Mind Stone. Fortunately, the Avengers stole the body from Ultron, and Tony Stark and Bruce Banner uploaded the remnants of J.A.R.V.I.S onto the body, creating Vision. Upon his wake, Vision announced that he is a hybrid of both Ultron and J.A.R.V.I.S, very much alive, and has only one goal which is to protect humanity.
Vision joins the Avengers in the Ultron Offensive, playing a very significant role in stopping Ultron's plans to transfer his consciousness to the internet. Together, they defeat Ultron and win the Battle of Sokovia. Vision then joins the Avengers as an official member together with Scalet Witch, War Machine, and Falcon, under the leadership of Captain America. As a result of the Battle of Sokovia, the Sokovia Accords was passed by the United Nations, breaking the Avengers into two groups - one in support of the Accords with Iron Man and another against it led by Captain America. Vision remained with Iron Man and was one of the few official members of the Avengers left. Although he remained with the Avengers in their facility, he also led a secret life with Scarlet Witch aka Wanda as her lover in Europe.
While in Europe, Vision and Wanda are attacked by Thanos' henchmen in a struggle to retrieve the Mind Stone from Vision. Captain America and Black Widow arrive at their aid, and they defeat the henchmen. Learning Thanos' intention for retrieving the Mind Stone, they make haste towards Wakanda to have the Mind Stone removed from Vision's head and destroyed, but without killing him in the process.
As soon as they arrived at Wakanda, Suri, the brightest scientist and Black Panther's sister starts the procedure. Meanwhile, Thanos had already sent his army towards Wakanda and before they could finish the procedure, his army penetrates the barricade and battle against the Avengers, trying to reach Vision. Before long, Thanos himself arrives and while the other Avengers try to fight him and stop him from reaching Vision, Vision tells Wanda to use her powers and destroy the stone, knowing it would kill him. In an emotional state, Wanda tries to destroy the stone but fails as Thanos gets to Vision and rips the stone from his head, killing him instantly, and thus completing the Infinity Gauntlet.