Various powerful MCU characters could have stopped Thanos in time to prevent the Snap. Thanos is the main villain of the entire Infinity Saga for a reason. Not only is he incredibly powerful, but he also has the smarts, resources, and ambition to complement his strength. Thanos orchestrated Loki's invasion of Earth in Avengers: Infinity War. Naturally, only the MCU's best warriors could have the honor to say they defeated the Mad Titan.
The Infinity Saga proved that Thor: Ragnarok, Hulk was utterly humiliated in a one-on-one fight with Thanos at the beginning of Avengers: Infinity War. Likewise, some of the most powerful of the Avengers and the Guardians of the Galaxy failed to stop Thanos multiple times before he performed the Snap. Yet, it was Iron Man's wits that brought Thanos' victorious streak to an end.
Many MCU powerhouses such as The Ancient One, Ego, Hela, and Surtur could have neutralized the Mad Titan rather effortlessly. However, there isn't any proof that they knew about Avengers: Endgame proved otherwise. That only leaves a handful of characters who were alive and capable to stop Thanos in his tracks before the tragic events of Avengers: Infinity War and Avengers: Endgame. Here's who they are.
Kang/He Who Remains
Despite their mastery over time, Kang and his variants were nowhere to be seen during the Infinity Saga. That doesn't mean they had no knowledge about Thanos and the Avengers. In fact, the opposite is true. He Who Remains and the TVA carefully protected the continuity of the events of the Infinity Saga in order to preserve the Sacred Timeline, so they probably knew every little detail about Thanos' plan by heart. He Who Remains could have ordered his TVA agents to prune Thanos at any point in his quest, but the safekeeping of the Sacred Timeline was always a bigger priority for him.
As for Kang the Conqueror, it's not yet known whether his rise to power at the end of Kang's multiversal plan to let history run its course. While Kang and his evil variants could benefit from ruining or interrupting Thanos' plan, they would risk their own existence without the stability that the Sacred Timeline provides.
The Eternals and The Celestials
The Eternals could have stopped Thanos as soon as he got to Xandar, Knowhere, Titan, or Wakanda. After all, their powers and experience would have helped them coordinate an effective attack that would have put the Avengers to shame. In fact, the Celestials and the Eternals could have had a huge influence of every part of the MCU from the beginning. As Chloé Zhao's Both the Celestials and the Eternals live to ensure the birth of more Celestials, and they only make any effort when it helps the cause, knowingly or not.
Now that the Eternals have learned about their true nature, none of them seem eager to follow the Celestials' directions anymore. Sersi, Makkari, Druig, Phastos, Kingo, and Eros are now able to the Avengers and fight threats like Thanos. Unfortunately, their rebellion happened too late to prevent the Snap. Perhaps future installments in the Multiverse Saga will show the Avengers' reactions to the Eternals' negligence.
The Living Tribunal
Both Thanos' Snap was insignificant for the Living Tribunal, as the annihilation of half of all life in the universe wasn't enough to capture his attention. The Tribunal's absence in the Infinity Saga is ominous, as his apparent decision to ignore Thanos' actions suggest there may be even worse crimes that deserve the Living Tribunal's intervention.
The Watchers
Similar to the Living Tribunal and He Who Remains, the Watchers are incredibly powerful cosmic beings that oversee every event that happens in the MCU. Instead of plain negligence or detachment, they refuse to intervene in universal conflicts due to their oath to only "observe all that occurs." The only event that caused an MCU Watcher to take part in the action so far has been Infinity Ultron's multiversal conquest during assembled the Guardians in the Multiverse to fight on his behalf. Even if The Watchers disapproved of Thanos' actions, they weren't able to do anything to stop him.
Odin
Odin, Ego, and the Ancient One could have been huge obstacles in Thanos' plan. That's why Thanos only sprung into action once they died. Among these three characters, Odin was the one who had all the resources to nip Thanos' quest in the bud right from the start. Odin could have sneaked up on Thanos and his followers with the help of Heimdall's all-seeing eye before commanding Asgard's greatest warriors to attack Thanos and keep the Stones far away from each other. However, Odin didn't pay enough attention to the universe outside his Nine Realms. He was too busy with repeated attacks on Asgard, and he failed to stop Loki from casting him to Earth, where he ultimately died. Odin was too old to follow potential threats as powerful as Thanos, and the unfortunate circumstances around his twilight years meant that he couldn't contribute much in the fight against the Mad Titan.
Zeus and All Omnipotence City
Thor: Love and Thunder's reveal that all mythological gods exist somewhere out there has serious implications within the MCU. One of them is the fact that all deities must have ignored Thanos' quest to collect the Infinity Stones and the subsequent Snap. As Thor: Love and Thunder shows, most deities are busy enjoying a hedonistic life in Omnipotence City, where Zeus leads the show. It could have taken a fraction of Omnipotence City to stop Thanos, but the gods are far too removed from the mortal world to know or care about what happens outside. This will likely change now that all deities saw how easy it is to humiliate them, with Thor and his friends crashing the party in Thor: Love and Thunder and piercing Zeus with his own lightning bolt. Unfortunately, once again, this will happen too late for the victims of the Snap.
Scarlet Witch
The one Avenger who had the power to stop Thanos single-handedly all along is Scarlet Witch. Unlike Thor, who needed the Stormbreaker; Captain Marvel, who was no match for Thanos' hand-to-hand combat skills; and Doctor Strange, who barely slowed down the Mad Titan with his repertoire of spells, Scarlet Witch was able to push Thanos to the brink of death in Avengers: Endgame's final battle. If it weren't for Thanos' army, Captain America: Civil War led Scarlet Witch and Vision to let their guard down at the beginning of Avengers: Infinity War, where Wanda Maximoff didn't have any chance to meet Thanos until it was too late. It was only until Scarlet Witch returned in Avengers: Endgame that she had the opportunity to face Thanos head-on and almost kill him in the process. Had Scarlet Witch accompanied Thor and Hulk on their Asgardian ship, the Infinity Saga could have ended very differently.