take the bitter with the sweet
Accept adversity as well as good fortune, as in Although he got the job, he hadn't counted on having to work with Matthew; he'll just have to take the bitter with the sweet. This idiom uses bitter for "bad" and sweet for "good," a usage dating from the late 1300s. It was first recorded in John Heywood's 1546 proverb collection. For a synonym, see take the rough with the smooth.