Warning: This article contains potential SPOILERS for Avengers: Infinity War.
Thanos has been hunting down the Infinity Stones for several years now, and he's finally coming to collect them all in Anthony and Joe Russo's Avengers: Infinity War. In addition to having characters crossover from one movie series to the next, and then teaming up every now and then whenever duty calls, one of the major ways in which Marvel Studios has been connecting all the storylines across the Marvel Cinematic Universe has been with the Infinity Stones.
There are six Infinity Stones that have existed since the dawn of time, before creation itself. Then, the Big Bang forced these primordial singularities to convert into concentrated objects that became known as the Infinity Stones. That's how the Stones came into existence in the Marvel Cinematic Universe, but the Infinity Stones' comic book origins are a bit different in some ways. Regardless, Thanos and his loyal Black Order have been searching for them for a long time so that the Mad Titan can use the Infinity Gauntlet to wipe out half the universe.
So far, five Infinity Stones have appeared in various movies throughout the MCU, and some have gone through intense journeys to get to where they are at the start of Avengers: Infinity War. Note that the below info regarding the Stones' locations at the start of the film were all taken from Infinity War's trailers and TV spots, but they may still be spoilery for those who want to go into the movie with as little information as possible.
This Page: The Space Stone & Mind Stone
Loki Has The Space Stone (Blue)
The Space Stone is the Infinity Stone that started it all. It first appeared in the post-credits scene for Kenneth Branagh's Thor, in which Nick Fury (Samuel L. Jackson) requests Dr. Erik Selvig (Stellan Skarsgård) to examine the Tesseract - the object in which the Space Stone lies. Then, it appeared next in Joe Johnston's Captain America: The First Avenger. It was in that movie that the Tesseract's power was used by the Red Skull (Hugo Weaving) to develop weapons for HYDRA. However, the Tesseract was lost at sea when Cap's plane crashed but eventually recovered by Howard Stark (Dominic Cooper).
Next, the Tesseract played an integral role in Joss Whedon's The Avengers. Loki (Tom Hiddleston) teleported into S.H.I.E.L.D.'s base via the Tesseract and used the Space Stone to open a portal above New York City in order to allow the Chitauri to invade Earth. Once the Avengers defeated Loki, the Tesseract was taken to Asgard and kept inside Odin's vault, where it remained until Loki once again took the Stone in Taika Waititi's Thor: Ragnarok. Now, judging by Avengers: Infinity War's trailers, Loki appears to have the Tesseract/Space Stone at the start of the movie. Of course, that is until Loki gives the Space Stone to Thanos.
Vision Has The Mind Stone (Yellow)
Although the Tesseract/Space Stone was the main focus of The Avengers, the blockbuster film also introduced the Mind Stone into the MCU. When Loki arrived on Earth, he came equipped with a scepter given to him by Thanos, which contained the Mind Stone. Loki used it to turn several S.H.I.E.L.D. agents, including Hawkeye, over to his cause. Eventually, the scepter fell into the hands of Baron von Strucker (Thomas Kretschmann), who had been using the Stone to experiment on humans in order to create miracles like Quicksilver and Scarlet Witch - both of whom aren't mutants in the MCU.
After being tipped off about the scepter's location from Agent Phil Coulson, the Avengers took back Loki's scepter at the beginning of Joss Whedon's Avengers: Age of Ultron. Then, later in the film, Tony Stark and Bruce Banner decided to upload J.A.R.V.I.S. into the synthetic body created by Ultron, which is then activated by Thor, who channels lightning into the body. But what gives the body - the Vision - life is the Mind Stone. That's where the Mind Stone has been ever since, and the Earth's Mightiest Heroes bring Vision to Wakanda in Infinity War to protect him from Thanos and the Black Order.