Although Joseph’s brothers had wanted to get rid of him, God used even their evil actions to fulfil His ultimate plan. He sent Joseph ahead to preserve their lives, save Egypt, and prepare the way for the beginning of the nation of Israel. God is sovereign. His plans are not dictated by human actions. When others intend evil toward you, remember that they are only God’s tools.
God brought good from the brothers’ evil deed, from Potiphar’s wife’s false accusations, from the cup-bearer’s neglect, and from seven years of famine. The experience in Joseph’s life taught him that God brings good from the evil for those who trust God. Do you trust God enough to wait patiently to bring good out of bad situations? You can trust Him because, as Joseph learned, God can overrule people’s evil intentions to bring about His intended results.
-- from The Life Application Study Bible
EDITOR'S NOTE: This has been reported by Snopes.com as an urban legend.