The Joseph narrative starts here. Joseph was born back in Genesis 30:22-24, but here he actually starts being a participant. He does not start off all that well---he's the youngest of the family and also the favorite of his father.
Joseph is not portrayed well here. He's seventeen, old enough to be working with the family flocks, but rather than staying with the work, he heads home to tell his father that they were not working the way should. Now, there is actually no telling what he said or whether it was true---he could have been acting like a Schrute and being picky. Or he could have been honest.
But we know this from v. 4: he does not get along with his brothers. The brothers specifically involved were the sons from Bilhah and Zilpah, so those would have been: Dan, Naphtali, Gad, and Asher.
Joseph does not help his relationship by sharing his dreams with his brothers. He has been dreaming about the future, and in his dreams he is the top dog. Many times, this gets preached and taught as God giving him the dreams, but do keep in mind that the text does not say this. The text only records that he reported the dreams--the source is not clear. The same can be said of Genesis 40, with the exception that Joseph clearly places interpretation of dreams into the hand of God.
After this, of course, his brothers are even less happy with him than they were. Apparently, dreaming about their downfall after informing Dad they weren't working right wasn't helpful for their relationships. The better-known part of Joseph's teen years then comes along: he's thrown in the pit, despairs of his life, and then is sold off to a band of Ishmaelites. He's then taken down to Egypt, sold as a slave to Potiphar, and his father is told he is dead. He is still slightly alive, which is more than can be said for the goat in 37:30.
Jacob commits himself to a lifetime of mourning for Joseph, cementing the fractures among the brothers.
What do we get from this?
First, don't throw your brother in a pit. Nobody needs to be down in the pit.
Second, find ways to work through your relationship issues. We see this echo back later in Genesis when the brothers are back together. They live with regret and fear over what they had done.
That's no way to live. Fix your relationships while you can.
Finally, recognize this: sometimes, people throw you into a pit. It's frustrating. It's depressing, and it may end in being sold off into Egypt. That's not cheerful, but life is not always cheerful. Sometimes it's painful.
There is hope that God will use you, your life, and your time in the pit to work out something better in the world. You may not see it clearly, but hold on. And if you're in the pit for a long time, maybe you can start seeking a way to climb out. You don't have to stay there!