A diamond in the rough
Here rough refers to the minerals (generally worthless) surrounding a diamond. This one has connotations of persistently digging through useless or negative things, to find that one diamond. In this case, the diamond is of obvious value, it’s just hidden among a lot of low-value/negative-value things.
It’s very similar to @bib’s suggestion of gold among the dross, though I have not personally heard that one used often. Certainly Google sees much more use of “diamond in the rough.”
Every cloud has its silver lining
Silver lining doesn’t imply the same amount of effort; it’s more just a positive aspect of something that is otherwise negative. It isn’t necessarily hard to find, but it may be hard to notice or appreciate due to the negative thing it came with. I commonly see it used, for example, when disasters brings a community together, helping one another out; that’s a good thing, but it’s not like anyone would recommend going through a disaster for the purposes of building or strengthening communal bonds.