Albus Dumbledore is the very first headmaster of Hogwarts seen in either the books or films — and in many ways, he sets a pretty high standard. He seems accessible, friendly, and even whimsical, but there's no question that he's a very powerful wizard, and it's widely known that he even strikes fear into the heart of the Dark Lord Voldemort (later portrayed by Ralph Fiennes). He more or less immediately becomes a mentor and confidante to Harry after, at just eleven years old, the Boy Who Lived thwarts Voldemort for the second time in his life, and the two end up working closely together to fight the seemingly endless forces of evil that end up invading Hogwarts.
There's a distance between Harry and Dumbledore after Voldemort's return in "Goblet of Fire," chiefly because the older wizard is concerned that Voldemort will be able to access Harry's mind through their mysterious connection and manipulate Dumbledore. After they clear that up in "Order of the Phoenix," though, they team up for the last time to track down Voldemort's Horcruxes, meaning the pieces of his soul he's scattered to obtain a temporary reprieve from death... until, when Dumbledore is weakened by one of their missions, he and Harry arrive back at Hogwarts, and Snape kills Dumbledore.