This question already has an answer here:

When Fred and George give Harry the Marauders Map, they explain how to use it. all one has to do is tap it with their wand and say "I solemnly swear that I am up to no good", and it transforms from parchment to map. to wipe it, tap it and say "Mischief Managed". but the Map had been locked up in Filches office (presumably from before the marauders left Hogwarts), and Filch didn't know how to use it (or couldn't, since he is a squib). so how did Fred and George know how to work the map?

marked as duplicate by Rand al'Thor Mar 18 '16 at 0:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.