It's widely known that Infinity War screenwriters Stephen McFeely and Christopher Markus, along with directors the Russo Brothers, took from different source materials while crafting their epic movie. The Infinity Gauntlet comic, which has officially been debunked as the title of Avengers 4, and Infinity War, were both used heavily while putting the script together. There are important characters from these comics that the MCU doesn't have access to, like Silver Surfer, whose role was taken on by the Hulk in Infinity War. Then there's a character like Adam Warlock, who hasn't yet been properly introduced in the MCU yet. Which is why Doctor Strange takes over his part in this telling of the story. There are Infinity War SPOILERS below, so read ahead at your own risk.
Adam Warlock was brought up during a post-credit scene in James Gunn's Guardians of the Galaxy Vol. 2, which got Marvel fans really excited. However, Gunn has gone to great lengths to warn fans that the character is not in Infinity War or Avengers 4 for nearly a year now, which means that much like Hulk standing in for Silver Surfer, another MCU character was going to have to fill the comic role of Adam Warlock in Infinity War, and more than likely, Avengers 4 as well.
In the Infinity Gauntlet comic, Thanos wipes out half of the population at the very beginning. This action leads to the Avengers going on the attack under the guidance of Adam Warlock since he knows the Infinity Stones (or Infinity Gems in the comics) so well, especially the Soul Stone. Warlock also has extensive knowledge of the Soul World, but he ends up letting some major superhero deaths happen in their battle with Thanos. It's later proven that this was all a major component of Adam Warlock's plan from the beginning. Thanos is later defeated because Adam Warlock reveals that his fate was pre-determined, which is where Doctor Strange comes in for Infinity War.
Related: 10 Best Popcorn Movies of 2018
Doctor Strange is seen in Infinity War figuring out the odds of the fight with Thanos going in a positive direction on Titan. When asked about the odds, Doctor Strange reveals that there was one instance where Thanos is defeated out of over 14 million possibilities. At the end of Infinity War, the Mad Titan gets his way, snapping his fingers and wiping out half of the universe along with a lot of the MCU's biggest heroes. When Tony Stark asks Strange why he gave up the Time Stone, he reveals that, "It was the only way."
Doctor Strange has seen the future and knows that the path of destruction was the only way to save the universe in the end. This further proves that Doctor Strange will play the role of Adam Warlock in the upcoming Avengers 4. Obviously, it's not clear where the movie will go, but it seems highly likely that Strange will continue to take on that role, especially taking in James Gunn's comments about Adam Warlock. As for Thanos, he defeats himself in the comics with his own psyche after thinking that he got what he always wanted. There have already been seeds of doubt planted in Infinity War with his ultimate sacrifice to obtain the Soul Stone. You can read more about the Doctor Strange and Adam Warlock similarities over at ComicBook.