The final ending of Genesis 37 takes some time to get to, with the reunification of the brothers happening in Genesis 45:1-15. A theme that I emphasize when teaching Genesis 37 and 38 is that the Lord can take something destructive or sinful and use it for his purposes and turn it into something good. We see this with Joseph, where he is betrayed by his brothers and eventually saves not only their lives, but countless lives through his spiritual gifts and foresight.
We see this also in Genesis 38, a rather dark story where Judah makes choices that bring shame upon his daughter in law as well as himself. The result of his choices bring about the twins Pharez and Zarah (Genesis 38:29-30). I point out to students that the cross reference in Genesis 38:29a takes us to Luke 3:33, which shows us that Pharez is part of the genealogy of Jesus Christ. God can work goodness in a world full of all kinds of difficulty! To say that he can only work through acts of holy men and women would limit his ability to do his work in this world of sin and destruction. The story of Judah and Tamar, and Joseph and his brothers is a beautiful illustration of this truth.
I also like to point out that the story of Joseph’s betrayal is actually a combination of two stories that are stitched together. When read from the Bible, this story can be kind of confusing. Is Joseph sold to the Ismaelites or the Midianites? Does Reuben suggest that Joseph not be slain, or does Judah? By seeing a visual representation that this text is actually two accounts that are put together, students can see the Bible in a new light. As a Latter-day Saint, I see no difficulty in understanding that the Bible is an accumulation of differing accounts with editors that have reworked and redacted the text, as this is exactly what the prophet Mormon did with the Book of Mormon!
Below you can see the different versions of the story of Genesis 37, color coded according to the separate authors or editorial schools that have given us the text. The yellow represents the “Yawhist” version of the story, and the blue text represents the “Elohist” author of Genesis 37. Read this way, readers can see with greater clarity that this text is the production of two differing authors or scribal tradition.