The path we walk can only be traveled alone in the end. You may walk alongside others and learn from their own path, but eventually theirs will lead them away from you.
Cherish the times you have with them, learn the lessons that are offered, and when the time comes let them go on their way. You are both growing and changing as you go. Even if the reasons for them leaving are not all peace and loving light you will begin to accept them eventually and move on.
There is a reason behind everything and, though you may not see that lesson until much later, you’ll be stronger for having known them and lost them as well.