Dumbledore is considered a hero of Grindelwald's War and the Wizarding War. In the former, he defeated and arrested Gellert Grindelwald (canon) himself. In the latter, he led the Order of the Phoenix (canon) in resisting Voldemort and the Death Eaters.
During the Wizarding War, Dumbledore learns about the destruction of the world being foretold by a large number of prophecies. He resolves to steer the future towards scenarios in which the world itself would be destroyed but the people would survive. This leads him to accomplish many seemingly unrelated tasks without knowing all their consequences, being only guided by the prophecies. In particular, Dumbledore permits Tom Riddle's attack on the Potter family on 31 October, 1981. Aside from ending the Wizarding War, the attack allows for infant wizard Harry Potter to be imprinted with Riddle's smart and rational mind before being raised by his loving and scientifically-litterate muggle aunt and uncle.
On June 13th, 1992 in Hogwarts, Dumbledore becomes trapped in the Mirror of Perfect Reflection by the Process of the Timeless. Dumbledore initiates the process as a trap for Tom Riddle but when Riddle presents Harry Potter as a hostage, Dumbledore lets himself get trapped in his place. In a letter, Dumbledore leaves as much resources as he can to Harry and gives him the task to fulfil the prophecies by destroying the world while saving its inhabitants.