A Blessing In Disguise - a good thing that you don't recognize at first. If some bad luck or misfortune ultimately results in something positive, it's a blessing in disguise.
Some people believe that good things are really "blessings" (gifts from God), that we don't always recognize for what they are at first.
Example:
Losing my job turned out to be a blessing in disguise because it forced me to think carefully about my future.