Harry is learning to create a Patronus spell. In order to create it, he needs to think about a happy memory. Hermione is the first person who comes to his mind. He remembers all of the happy memories they got and how they fell in love with eachother. At first Harry didn't want Hermione to love him, because he was afraid of what might happen to her. Hermione didn't want a no for an answer and helps him to defeat Voldemort. But then she got killed by Bellatrix and Harry is heartbroken of it. Still he remembers the great memories they had and he can create a Patronus spell because of it.