Failed relationship hurts specially if we have invested so much time and effort to make the relationship work. But think about it, if we keep holding on to a relationship just because we love the person and we have invested so much time and effort on them, do you think it will make the relationship work if the other party have already fallen out of love?
For me, it is better to let go and let the person be happy rather than hold on to him. You are not only doin him a favor but you are doing a favor to yourself. It will hurt ofcourse, you will cry, you will have so many flashbacks that makes your heart ache, but trust me, you will be able to pick yourself back up. Give yourself some time coz time can heal the pain. Love is a very beautiful thing but love is also the most painful thing. Just know that no matter how painful it is, you will get over it. You will be able to someday smile at the memories.