Man, there are like 22 films. Does anyone really want to try to order them for you? Also, Marvel TRIED to build the narrative in terms of how the films were released. So it's not like they jumped all over the map, there were lots of post-credit scenes to set up the next film(s). They did the job for you. It's more a matter of what you can skip.
For example:
- You can skip the Ant-Man films; they've got some fun moments but pretty much don't tell you anything you need to know, EXCEPT (1) how Scott gets caught in the quantum dimension (so watch the post-credit for AM2 and (2) one of the biggest emotional payoffs of Endgame, when Scott and Cassie see each other.
- You could feasibly ignore Dr. Strange, because all you need to know is that the Time Stone is inside the Eye of Agamotto and is responsible for its Time effects (versus the comic book version, which I think was just an artifact?)
- Captain Marvel can be ignored, unless you just want to understand her powers which aren't really explored deeply anyway. Like, seriously, there's little there that matters aside from "hey, it's Supergirl on a galactic level."
- The Hulk movies can be ignored, esp because they are almost like separate stories with different actors playing Bannor. Nothing really matters except to explain why he is Calcutta when the Avengers starts.
- The Spider-Man films again do emotional setup rather than story setup -- I would watch the first one if you want to understand the father/son relationship between Stark and Parker, you could ignore the second since it came out after Endgame anyway I think. So it's a big deal when Spidey gets stuck in space with Iron Man on this one-way mission and he gets "knighted' to be in the Avengers.
- I don't really enjoy Cap Amer 1 that much, but it's essential to getting the emotional payoff of Endgame + the origin part is pretty great (again, important lines in there for Endgame), and then the whole deal with Bucky. Does Cap Amer 2 actually contribute to the infinity stone sequence? Maybe not -- but it's one of the best films in the sequence and leads right into Cap Amer 3, Civil War -- which you have to watch.
- All four Avengers are necessary
- Thor 1 and 2 are kinda meh. I guess it helps to track the tesseract, and if you want to understand what the Reality Stone is (Thor 2), but it's done pretty horribly and is still confusing AF -- it's almost easier just to read the synopsis and not torment yourself, everything you need to know about the Reality stone is that it's one of the 6 and it works how Thanos uses it in Infinity War. Meanwhile, Thor 3 I don't really contributes to much except Thor's relationship to Loki + explain why all the Asgardians are on two large spaceships, opening Infinity War.
- Black Panther simply explains the whole setting for a portion of Infinity War (so you grasp what a "risk" it is for Wakanda to put itself on the line for the planet and why he's doing it), but a lot of it's just about BP's "origin" story.
- Guardians of the Galaxy 1 should be watched, it explains the power stone and might be one of the most coherent visualizations of the power of the infinity stones in general. I personally really like GotG2 a LOT, but the most essential thing in it is just to (1) show how Peter and Gamora drew closer and (2) how Gamora and Nebula buried the hatchet, which has a big payoff in Endgame.
- Iron Man 1, because it was the first, and Endgame ties up the Iron Man arc. I don't remember much of Iron Man 2 or 3, aside from how Pepper and Tony end up together and his ongoing maturation as a human being. I guess Iron Man 2 introduces Natasha?
What did I miss?
Anyway, I'd just watch the necessary ones in release order, probably, barring taking another 2 hours to review all the content and post-credit sequencing...