A silver lining is a metaphor for optimism in vernacular English, which means a negative occurrence may have a positive aspect to it.
[2] John Milton coined the phrase 'silver lining' in his poem Comus: A Mask Presented at Ludlow Castle, 1634: I see ye visibly, and now believe That he, the Supreme Good, to whom all things ill Are but as slavish officers of vengeance, Would send a glistering guardian, if need were To keep my life and honor unassailed.
Was I deceived, or did a sable cloud Turn forth her silver lining on the night?
I did not err; there does a sable cloud Turn forth her silver lining on the night, And casts a gleam over this tufted grove.
[3][4] It is a metaphor referring to the silvery, shining edges of a cloud backlit by the Sun or the Moon.