God sent me before you to preserve life. (Genesis 45:5b)
It is clear that although Joseph's brother's intended great evil for him (and, let's face it: he was insufferable), God used their evil intent, all their human frailty, and an objective moral wrong to save many lives.
This gives me hope regarding good things that may eventuate from our own stupidity and wickedness. This does not justify either but it does offer hope of redemption.
It also teaches us how one's perspective may change. We need to be open to reassessment or we can miss what God is up to.
O Lord, we beseech you mercifully to hear us; and grant that we, to whom you have given a fervent desire to pray, may, by your mighty aid, be defended and comforted in all dangers and adversities; through Jesus Christ our Lord, who lives and reigns with you and the Holy Spirit, one God, for ever and ever. Amen.