In the movie "Spider-Man: No Way Home," it is suggested that the spell cast by Doctor Strange has a multiversal effect, allowing individuals from other universes to enter the main universe. The spell specifically targets people who know Peter Parker/Spider-Man, which is why characters from other universes who are familiar with their respective Spider-Man (such as Tobey Maguire's Peter Parker and Andrew Garfield's Peter Parker) end up appearing in the main universe.
Regarding whether Tobey and Andrew are forgotten in their own universes, it is not explicitly addressed in the film. The focus of the story is primarily on the events occurring in the main universe and how they affect Tom Holland's Peter Parker. The movie does not provide detailed information about what happens to Tobey and Andrew's characters after their involvement in the main universe's events.
It's important to note that the specific details and interpretations of the movie's events may vary, as the storyline and character arcs can be subject to creative choices and future developments. To get accurate and up-to-date information, it's best to refer to official sources or watch the movie itself.