The Marvel Cinematic Universe's Phase 4 as the franchise fully explores the multiverse. 

2018's Infinity War was the first time Strange made his presence known in the larger MCU as he teamed up with Iron Man (Robert Downey Jr.) and Spider-Man (Tom Holland) in bringing the fight to Thanos (Josh Brolin) on Titan. While he was among half of the universe who perished via the snap, he was instrumental in setting the Avengers' plan in motion, ensuring that they would ultimately win and take down the Mad Titan. He was able to peek into the future and see the potential outcomes of the conflict. Five years later, he and the rest of the decimation victims returned in Endgame just in time to help in the fight against the purple villain and his minions. 

Related: What If The Eternals Were In Infinity War: Would Thanos Have Lost?

Strange functioned as the spiritual leader of sorts for the Avengers during the attack; he was the only one, aside from Doctor Strange movie prior to dying to Dormammu, Stange's curiosity got the better of him and he decided to try using the Eye of Agamotto with a magic spell from the Book of Cagliostro. He manipulated time on an apple, taking it backward and forward, and breaking multiple rules in the process. If it wasn't for Wong and Baron Mordo (Chiwetel Ejiofor) stopping him, he could've permanently damaged the fabric of reality.

Doctor Strange theory multiverse of madness motivated by Infinity War

One of the reasons why Strange appeared to be tame in Infinity War is because he was teamed up with Tony Stark, who's also very cocky. Throw in Star-Lord (Chris Pratt) who also tends to run his mouth and the Russo Brothers needed to ensure that it's not just a contest of ego among them. In the end, they decided to subdue the sorcerer; that doesn't mean, however, that he totally lost his sense of arrogance. In No Way Home, Peter needs Strange's help, and since he's partnered up with a fairly modest character in the web-slinging hero, his overconfidence shines through. Perhaps the fact that the Avengers were able to defeat the MCU's biggest threat yet thus far in Thanos fueled his ego into believing that he can be bolder with his experimentations. Peter's plea for help may have given him the justification to perform the dangerous spell. For what it's worth, Wong's comments made it seem like he knew that Strange has long wanted to execute the said incantation. Unfortunately this time, no one is there to stop him from making such a grave mistake leading to the multiverse looking like it's being opened up. 

Based on Spider-Man: No Way Home trailer, Strange's incantation doesn't go to plan. Part of it is Peter meddling while he was casting the spell, which understandably frustrated the sorcerer. But frankly, he started the whole commotion. Had he listened to Wong's caution and stayed true to his promise, their problems in relation to the multiverse being chaos wouldn't exist. 

More: Why Thanos' MCU Return Makes Him So Weak