St. Paul says, in the Epistle to the Romans, 8:28, "And we know that all things work together for good to them that love God, to them who are the called according to his purpose."
There is a story from ancient China. A man had only one horse. He left the barn door open one night and the horse escaped, so the man told his neighbor that he was very unhappy over the loss of his horse.
The neighbor replied "Be neither sad nor happy, for we cannot judge the ultimate consequences of an event."
The very next day, the horse returned to the barn leading with him many wild horses he had befriended in the wilderness. The farmer was now delighted with his windfall wealth and went to his neighbor saying "How happy I am now to be wealthy in horses."
Once again the neighbor advised "Be neither happy nor sad, for we cannot foresee the ultimate consequences of any event."
The following day, the farmer's son chose the most beautiful wild horse to tame, but his leg was crushed when the horse threw him, so again the farmer was sad and spoke to his neighbor, who again said "Be neither happy nor sad, for we cannot know the final outcome of such events."
The day after the king and his army came seeking young men to recruite to fight in a war in which most would surly die. But seeing the farmer's son with his crushed leg they said "He is useless to us! Let us depart!"
So, once again the farmer rejoiced and told the neighbor of his joy, that Fate had spared his son from certain death. And once again the neighbor replied, "Be neither happy nor sad at any event, for we cannot know it's ultimate consequences in this world of causality."