In Spider-Man: No Way Home, Peter Parker asks Doctor Strange to erase public knowledge of his identity.
After Mysterio reveals that Peter is Spider-Man, Peter visits Doctor Strange at the New York Sanctum. He asks Strange to cast a spell making everyone forget that Peter Parker and Spider-Man are the same person, hoping this will restore his friends’ futures and privacy.
The spell becomes unstable when Peter repeatedly asks Strange to preserve the memories of specific people, including Aunt May, MJ, and Ned. Strange contains the damaged spell, but its magical effects draw people from other universes who know Spider-Man’s identity into the Marvel Cinematic Universe.
The film later raises the stakes by requiring Peter to choose between protecting the multiverse and preserving his relationships. The final spell erases Peter’s identity from everyone’s memory, including MJ and Ned. Wong is also a sorcerer, but he does not cast this spell; Mordo and Loki are unrelated to this particular request.