The universe gives you what you need when it is your time to understand it. You can long for a favored outcome but the Architect holds a silent, unseen hand on your rudder, and you will go where the river directs you.
This does not suggest that you do you not work for your goals; that you do not invest your heart; that you do not suffer the sleepless night; that you do not rise up again and again in the face of disappointment; that you do not fight injustice. It is in these struggles, in these challenges, in this pain, that the lessons are found.
You cannot know before the end what will come to pass. Or whether it will be all you had imagined. The future remains shrouded. The goal must not be simply to attain your desired outcome. Over that, you have no control. The goal is to find the lessons in the reasons you may not have achieved your goal. Happiness and satisfaction lie in finding the delicate balance between striving towards an outcome and stepping back to observe and understand why things are the way they are, or why you did not get what you wanted so badly. There is no such thing as failure or loss if you take the lessons. This is the secret to inner peace.