for the best

for the best

Said of something that is a positive occurrence (especially when it initially seems bad or problematic). This is usually an expression of hope or insight after something has gone awry. I had to go home and change after spilling coffee on myself, but it was for the best because I avoided a major traffic jam. I was really disappointed to get rejected from my first-choice school, but I think it will be for the best because now I won't be so far from home.
Farlex Dictionary of Idioms.

(all) for the best

good in spite of the way it seems; better than you think or than it appears to be. (Often said when someone dies after a painful illness.) I'm very sorry to hear of the death of your aunt. Perhaps it's for the best. I didn't get into the college I wanted, but I couldn't afford it anyway. It's probably all for the best.
McGraw-Hill Dictionary of American Idioms and Phrasal Verbs.

for the best

With an ultimately positive or preferable result.
American Heritage® Dictionary of the English Language, Fifth Edition.
See also:
  • all for the best
  • (you) wanna make something of it?
  • a/the feel of (something)
  • (I) wouldn't (do something) if I were you
  • a straw will show which way the wind blows
  • a crack at (someone or something)
  • all right
  • (do) (you) want to make something of it?
  • add in
  • a thing of the past