Joseph suffered a lifechanging trauma when his brothers beat him and cast him into a pit, intending to kill him. His story shows how God can triumph even in our darkest moments and shows us something of the Person and Work of Jesus Christ.
Here is a link to David Guzik's commentary on Genesis 37: https://enduringword.com/biblecommen...