What is the meaning of [All’s well that ends well.]

As long as the outcome is good, problems on the way don’t matter.

Example: I’m glad you finally got here, even though your car had a flat tire on the way. Oh well, all’s well that ends well.