It takes a lot of time and reflection to be able to accept things as they are, especially since this often implies that one didn't get to have what he or she is hoping for.
I don't think there's a straight path towards acceptance; people deal with it in their own little ways.
As for me, what I usually do is to recognize the situation. No matter how vague it is, I'll try to reflect on the things I did and didn't do, and to the decisions I chose to take that led me into such shortcomings. I also tell myself that there will always be uncertainties in everything I do, and that I can't have the best of both worlds. All these are easier said than done and oftentimes realizing all of these, as I've said, entails a lot of thinking.
What makes it harder to accept certain things is to also recognize that it isn't meant for you but for others, it is. During these times, there's really nothing you can do but to accept it.
Life is tough, but that doesn't mean we should give up. With acceptance comes maturity, and when we reach this point, I think it'll be a good start for us to do better next time.