She helped him practice spells for the task, despite not knowing what the task was. When Harry found out, via Hagrid, the task involved dragons, Hermione went to the library and looked for any books that might have something to use against the giant lizards. Harry told her he had a plan, but she insisted he know how to cast some of the spells, in case his first plan didn’t work.