Some people are toxic and you have to let them go or even slam the door. Some people it's not so much toxicity, but the emotional impact of keeping them around is not worth it.
If they have behaved hideously you have every excuse to shut them out, but if it's more ambiguous (disappointed expectations, lower-level but ongoing hurtful behaviour, etc) it can be even harder in some ways. I'm wary about letting people back in though I guess a couple of times it has more or less worked out.
Also, to get over someone (especially romantically) it's almost like I HAVE to dislike and resent them. I know that's not good, but I can't keep hanging onto the good stuff, it makes it harder. So there tends to be a long period of resentment and hurt and then - just nothing, which is blessed relief. But it obviously kills any friendship/relationship. If it's someone I was in love with or had strong feelings for I sort of go from the extreme of idealizing them and caring almost too much, to seeing everything they did wrong and dwelling on all the ways they hurt me. The Mr Darcy line in Pride and Prejudice applies quite well to me - "My good opinion once lost is lost forever."
I also kind of force myself to conclude that they don't care at all. The weird thing is, the evidence very much suggests that people want to keep me in their lives, with rare exceptions. They usually "want me back" in some form, eventually. It has surprised me with a couple of people because I myself said some pretty harsh and hurtful things to them when I reached that point. It seems there is something they miss but I get to a point where I think "that's their tough luck". Almost with a bit of vindictive pleasure, but I know it's to mask my own feelings of hurt.
In any case there is a huge amount of emotional fallout for me. It generally takes years before I can think of the person or anything related to them without at least some pain
I question my own behaviour and my own motives so much when I reach this point. I wonder if I am disloyal and should have approached things differently, etc.
The facts ultimately convince me otherwise because I have maintained many friendships for many years and am widely viewed as loyal. In fact, I know that sometimes I have put up with too much. But every situation like this that arises, even if there aren't many, I question myself agonizingly over what I and they could have done differently.