It means that you should always see stuff on the bright side of things. It's kind of like the saying that the cup is always half-full. Be optimistic about life, because even though a bad trial might have happened, it has been put there for a purpose!
Hope this helps!!