Genesis 37:26 And Judah said unto his brethren, What profit is it if we slay our brother, and conceal his blood? 27 Come, and let us sell him to the Ishmeelites, and let not our hand be upon him; for he is our brother and our flesh. And his brethren were content.
In the situation with Joseph, what transpired with his brothers, and the consequent sale of Joseph to the Midianites may seem to baffle the mind, for it looked as if his envious brothers were having their own way. But here again, God was in control in the background, silently working out His own good purposes for not only Joseph, but for his brothers and for all of Egypt too.
[Prophets And Kings pp 500] In the annals of human history, the growth of nations, the rise and fall of empires, appear as if dependent on the will and prowess of man; the shaping of events seems, to a great degree, to be determined by his power, ambition, or caprice. But in the word of God the curtain is drawn aside, and we behold, above, behind, and through all the play and counter-play of human interest and power and passions, the agencies of the All-merciful One, silently, patiently working out the counsels of His own will.
It will be discovered that God could work with any hand that is dealt Him, because what may seem to thwart His purposes, is often incorporated into His planning, and in many cases, actually facilitates the outcome. Thus, we can agree or disagree with God, but at the end of the day, His will would get done. That is what the prophet Isaiah is actually saying in our first passage. To be frank, it can be pretty scary!
Genesis 39:1 And Joseph was brought down to Egypt; and Potiphar, an officer of Pharaoh, captain of the guard, an Egyptian, bought him of the hands of the Ishmeelites, which had brought him down thither. 2 And the Lord was with Joseph, and he was a prosperous man; and he was in the house of his master the Egyptian. 3 And his master saw that the Lord was with him, and that the Lord made all that he did to prosper in his hand.
May The Lord add His blessing to the study of His word. God bless!