Joseph's brothers hated him because his father favored him more than his brothers. And they sold him into slavery in Egypt, intending to get rid of him. Then they let their father fool himself into believing that Joseph was dead. His father suffered greatly for years, without those sons letting him know his beloved son was still alive . . . or could be.
Then there was the famine which drove them to go to Egypt to seek food. And by then Joseph had been blessed by God and used to take charge of the resources of Egypt, so those brothers would have a . . . reunion . . . with Joseph. They were in for a big surprise, to say the least.
Joseph helped them, ministered loving and kind forgiveness to them, and this while he was helping so many people to have food so they would not all die.
God was using their wrong actions to set Joseph up to do all-loving good to people. While we go through something for Jesus, we can do what is all-loving, not only for our own selves and ones closer to us.
Joseph understood this > he told them it was God's intention, how he had been sent to Egypt before them so he could prepare resources for their needs when the famine came. God knew all along how there would be the famine, and He had things in His control of those brothers, so Joseph would be sold into Egypt so then God would use Joseph to help his family plus so many other people.
So, He used those brothers, the way they were, to accomplish His purpose. But he was, of course, not pleased with them, how they hated their own brother and so betrayed their own father to so suffer for so long.
But this is similar to what He did with Jesus, too. He used the horrible people who hated and tortured and murdered Christ God's own Son. But those who have not repented of that are in major trouble. But with God we can make good use of the crucifixion of Jesus. It has turned out for such great and all-loving good, for us who have trusted in Jesus > Ephesians 1:12.
Because God is all-loving, He uses things not only for us ourselves, but for all-loving good. So, we need to have this focus in our praying, caring for any and all people and not only for our own selves, in order for us to be capable of benefitting from how God answers our prayers, which He always is doing. We need to have the perception, patience, and all-caring creativity of His love >
"And this I pray, that your love may abound still more and more in knowledge and all discernment." (Philippians 1:9)
So, this takes maturing and correction in our character.
So, then > did those brothers really benefit from how God used Joseph to help them? They needed to truly change in their hearts, so they could really benefit. But Joseph was kind even to Egyptians who were not godly; he used his time of trouble to reach them and help them to know the true and living God. This is also what was intended, I would say.
In any situation, if we are God's way, we too can help others with our example and message of who and how God is, and how the Gospel is for us. So, thank You, God, for this.