Hermione Granger taught Harry Potter the Accio spell or the Summoning Charm. Since Harry was finding it very difficult to figure out a way to get the golden egg from the dragon in the first task, he was approached by Mad-Eye Moody and was suggested to try the Summoning Charm to get his broomstick mid-task. Hermione, being the talented and well-read witch that she is, figured out a way for Harry to practice it by summoning random objects like gobstones, chairs, and books. She then taught him the spell till he became thorough with it.