Before Harry's fifth year at Hogwarts, Dumbledore has trouble finding anyone for the DADA job, and so Fudge gives him Umbridge. He must've known why Fudge wanted Umbridge there, and he must've known also that it wouldn't work out too well for him. The next year, he hires Slughorn as Potions teacher and Snape as DADA, which worked out fine. Except the part where
Snape killed him at the end of the year, but he wanted that to happen.
So why couldn't he have hired Slughorn a year earlier? It would've made life much less depressing for all of us.