The maltreatment of Joseph began with the evil plans of his brothers.
Joseph’s brothers resented Joseph on many levels: He was their father’s favorite son (and Joseph made no secret that he knew that his father’s favor rested on him); and Joseph made much of his dreams, in which he seemed always to be the hero.
The good news here is that God works on many levels, too. Joseph’s circumstances were used by God to fit Joseph for God’s work; he used the brothers’ guilt to provoke confession and true repentance; and throughout, God was glorified for His love and His mercy.
Like Joseph, we do not know where life will take us; but we should never doubt that God is at work in our circumstances — however hopeless from our perspective — to transform us into the image of Christ; to bless others; and to glorify God. If we are convinced of this, though we may fall down, we shall not stay down! – Luther