The one good thing about a bad experience is that you're sure you can handle a lot more in life. Congratulations, you're now officially a stronger person to take on the world and all its unpredictabilities. If you can only take away the bitterness from the experience. And keep your ego aside. If only.
I wonder sometimes if it is worth getting sad over anything at all. Does anything matter in the long run? You get sad, you get over it, you move on. And you're back to square one. Did anything beneficial happen in the interim period of melancholy? Um.. Let me see, your heart was under pressure, you probably were depressing company for your near and dear, got them depressed as well, and gained.. well.. zilch (barring some weight that overeating triggered by your feelings caused.)
But of course, this is far from easy. This kind of an atitude requires some sort of emotional detachment which means one of two things. Either you never get emotionally attached to anything, or you learn to detach on demand. Obviously, the first option is out of question because being human is almost synonymous with having emotions. And if you don't, you're not going to have much of a life anyway! Detach on demand is well, really beyond my scope, but I believe it can be attempted by a lot of ways in combination: looking at the bigger picture, putting the problem in the most optimum perspective, keeping yourself busy, countering it with new ways to make you feel better about life, and in some cases, fighting back with a smile on your face!