Elder Hartman Rector Jr. explained: “[The] ability to turn everything into something good appears to be a godly characteristic. Our Heavenly Father always seems able to do this. Everything, no matter how dire, becomes a victory to the Lord. Joseph, although a slave and wholly undeserving of this fate, nevertheless remained faithful to the Lord and continued to live the commandments and made something very good of his degrading circumstances. People like this cannot be defeated” (in Conference Report, Oct. 1972, 170; or Ensign, Jan. 1973, 130).
Romans 8:28. See also Genesis 39:2-3