every dark cloud has a silver lining

every dark cloud has a silver lining

It is possible for something good to come out of a bad situation. (A silver lining on a cloud is an indication that the sun is behind it.) I know you're upset about not getting the lead in the school play, but just keep in mind that every dark cloud has a silver lining—you'll get lots of experience as the understudy! When I'm going through a hard time, I try to remind myself that every dark cloud has a silver lining.
See also: cloud, dark, every, lining, silver