Looking back, through the blurry lens of memory, at all the people whose time in your life was far too short can bring both joyful memories and empty sadness as you realize that you will never see them again.
Try to focus o the good times that you shared. Don't focus, even for a minute, on the way things might've been if they were still in your life.
Realize that their time around you was the length of time that it was meant to be, no more, no less, and don't regret that it was short. They came into your life to provide you whatever they provided (help, joy, inspiration, a needed lesson, or a cold dose of reality) and once that was done, they weren't necessary to be in your life -- as far as the Greater Plan is concerned, that our Good Lord has prepared for you.
Be not too saddened by this -- there will be at the right time -- someone who has a lifetime to give you. And when that person comes, they will never leave.
Knowing the difference between those who aren't meant to be in your life forever and those who are isn't really possible -- and that, in and of itself, is a huge lesson to learn. Because, if you don't learn that single lesson, you might waste a lifetime of happiness ruing the loss of someone not meant to be in your life any longer.