The major themes of Genesis come to a head in the final chapters of Genesis pointing us back to the beginning and pointing us forward to Christ, showing that God undoes sin’s curse by fulfilling His promises in Christ.
Just as God used the sinful actions of Joseph’s wicked brothers in their betrayal of Joseph to accomplish His purposes and preserve a remnant, so too God used the sinful actions of wicked people in the crucifixion of Jesus to accomplish His purposes and preserve a faithful remnant.