Genesis 50:20, “...you *meant* evil against me, but God *meant* it for good...”
Don’t miss the parallelism in this statement. It is not that Joseph’s brothers *meant* evil, and that God *used* their actions for good, it is that—in the very same action—the brothers meant evil and God meant good. There are at least two purposes at work in every happening... there is the purpose of the human agent (always alloyed with sin), and there is the purpose of the divine agent (always perfect in holiness).
However, one difference we have to keep in mind between these two purposes is that God’s purpose takes into account what we might call ‘the whole story’. He wills each particular event not as an isolated incident, but as part of the overall weave of reality, as one stroke in the painting of created history—the painting which will be, when completed, His own self-portrait in His Son (Eph.1:10). In this way, it is possible to ‘see’ every event in two ways which may in some sense be analogous to the two natures of Christ (which is no surprise since He is the pattern upon whom created reality is built)....we can ‘see’ an event according to the Flesh, or we can ‘see’ it according to the Word. To see according to the flesh is to see only the event and the purposes of the created agent in that event... however, to see according to the Word is to see (or hear) the ‘Word’ in every event of the ‘Flesh.’ What I mean is, it is to receive every event (by faith) as one that will finally be revealed to have been a lovingly authored step toward the gathering up of all things into the proclamation of God’s beauty in Christ.
And that—ie, the reconciliation of reality to God in the crucified and risen Jesus, such that all things sing the name of God in Christ—is ultimately the only way Genesis 50:20 is true. How can an evil action be ‘meant’ by God for final good? Only because ALL evil actions are dealt with on Calvary... only because ALL sin, suffering, monstrosity and death is borne in the experience of the Beloved Son on the Cross and so turned—with His resurrection—into a servant of His people’s joy, a herald of divine love, and a witness to the beauty of God’s own Name.