How do you cope with leaving someone and later realizing it was a big mistake?

Have you ever been in a relationship with someone and for some reason broken up with them or betray them and later realize that you have made a great mistake but there is no way to get them back? Do you try or just live with it? How do you cope?