Dr. Strange explains to Stark in Infinity War as follows:
Strange: I went forward in time, to view alternate futures. To see all the possible outcomes of the coming conflict."
Stark: How many did you see?
Strange: 14,000,605.
Stark: How many did we win?
Strange: 1.
And as a result of this, Strange cedes the Time Stone to Thanos to nagivate the one path.
Now, it is at least strongly implied that among the integral characteristics of the one winning outcome are who is snapped into non-existence and who is not. It appears that the winning timeline presumably requires that:
All the original Avengers plus Potts, Lang, Rhodes, Nebula, Rocket, and Capt. Marvel etc. survive and that essentially everyone else disappears, including Barton's family, etc.
At the very least, it's obvious that Endgame required the combination of character for various reasons in order to play out the way it did and only minor alteration could have been tolerated.
From a purely statistical perspective, of course, that exact (or very similar) combination of dusting/non-dusting is extremely unlikely. So I imagine we are meant to believe that somehow the only reason it happened that way is because of the choice(s) that Dr. Strange made.
Assuming all of this,
How exactly did the actions taken in Avengers: Infinity War result in the one of 14,000,605 timelines and the configuration needed for Avengers: Endgame? What (if anything) did Dr. Strange need to do to lead to the events of Endgame?
Related: How did Doctor Strange see the winning outcome in Avengers: Infinity War?