When people enter into your life, it is almost never up to you what role they will play, no matter how hard you try and force it.
And when they exit, almost always too soon for your liking, you are left with trying to reason why they’ve gone, what you learned from them and why it’s ok that they’ve moved on.
Some people just aren’t meant to stick around forever. No one’s to blame. They fulfilled their role, made some aspect of your life either better or worse. You both got what you needed (realizing that part may take a while). Whatever the reason, you became friends long enough to: be there to save their dog from a burning building; they helped you through a death in the family, you helped them through (multiple) breakups, they coached you in the trade you now call your profession, etc, etc.
Though very different things, there is a link between forgiveness and acceptance.
All you can do is hope you’ve been a positive force in the lives of the people you yourself have left behind and respect the ones who are still putting up with your sorry ass 😉