When determining the order Thanos (Josh Brolin) would assemble the six Infinity Stones one by one throughout Avengers: Infinity War, screenwriters Christopher Markus and Stephen McFeely saved the worst for last. Because the movie opens with Thanos already in possession of the Power Stone — claimed by the Mad Titan off-screen when he decimated Xandar, home planet of the Nova Corps — Thanos is only seen acquiring the Space Stone, the Reality Stone, the Soul Stone, the Time Stone, and the Mind Stone. As Markus and McFeely explained while live tweeting with ComicBook.com during the two-night #QuarantineWatchParty event, the last stones would only be collected after sacrifices from the heroes:
When the Avengers writers were asked if they always knew the exact order Thanos would collect the Infinity Stones, McFeely answered, "All we knew at first was that the ones that involved the sacrifice of heroes should be last."
Thanos stole the Space Stone after attacking a ship filled with Asgardian refugees, among them Heimdall (Idris Elba) and Loki (Tom Hiddleston), who were killed in front of a defeated Hulk (Mark Ruffalo) and Thor (Chris Hemsworth). The Reality Stone was acquired from the Collector (Benicio del Toro) on Knowhere, shortly before the arrival of Star-Lord (Chris Pratt) and his Guardians of the Galaxy.
Requiring the sacrifice of a loved one, Thanos only obtained the Soul Stone after throwing favorite daughter Gamora (Zoe Saldana) from a cliff on Vormir. A different sacrifice occurred when Doctor Strange (Benedict Cumberbatch) was forced to give up the Time Stone to spare a defeated Iron Man (Robert Downey Jr.), whose survival was key to thwarting Thanos' plans to destroy the universe in Avengers: Endgame, where it was Tony Stark who used the combined might of the six Infinity Stones to obliterate Thanos and his army at the cost of his own life.
Infinity War ended with Thanos invading Wakanda, the kingdom of the Black Panther (Chadwick Boseman), to retrieve the Mind Stone embedded in the head of android Avenger Vision (Paul Bettany). Knowing it would kill him, Vision pleaded with lover Wanda (Elizabeth Olsen) to use her immense powers to shatter the Infinity Stone powering his body, denying Thanos his prize. After failing to prevent Wanda from killing Vision, Thanos rewound time to moments earlier and ripped the Mind Stone from Vision's head — killing him.