The idiom “all is well that ends well” means that everything will be okay in the end. It is used to say that a person can forget about how unpleasant or difficult something was because everything ended in a good way. It implies that the end result justifies the means of achieving it. The phrase is often used when a project or process has a positive ending despite problems during it
Try using this idiom in your conversation the next time you get though a difficult situation.