The important thing to know about Joseph is that he is a just man. (Matthew 1:19) The dictionary meaning is doing what is morally fair and right. Joseph is a man who takes the moral high ground. God picked a good husband for Mary and a good earthly father for His Son, Jesus. This would be a better world to live in if everyone was raised by a father who was just.
And it was a good thing that he was just. When he was betrothed to Mary, he got word that she was expecting and was prepared to quietly end the engagement. Joseph, after an angel appeared to him in a dream, married Mary as the angel had bidden him. (Matthew 1:24) Joseph's character is so important to the birth and childhood of our Savior, Jesus. An angel visited Joseph three more times after this. The second time to escape into Egypt (Matthew 2:13). The third time when Herod had died (Matthew 2:19-20). And the fourth time when he was warned not to go to Judea (Matthew 2:22). Every time God's angel spoke to him, Joseph obeyed.
Joseph, not mentioned much in the Bible, turns out to be the determining factor in the survival of Jesus. He is living proof that God doesn't make mistakes. Herod the Great was the King of the Jews at this time. He had been in power for the better part of 40 years. No one, no one was going to replace him. A cursory reading of his biography tells one to what extremes he was willing to go to maintain his power. Herod was so consumed with his power that he ordered all the male children in and around Bethlehem under two to be murdered.
This is the reason for the second visit from the angel.
Joseph was told to take Mary and the child and go to Egypt. Matthew 2:13-14 leaves no doubt that Joseph got up in the middle of the night and they left. After the threat of Herod had passed the angel came again and told him to take his family and go back into Israel. Once there Joseph learned that Herod's son, Archelaus, was in power and had been warned in this, the final dream to go into Galilee. He did so and settled in Nazareth. There he raised his family and worked as a carpenter.
Joseph, not a notable human being, was chosen by God for his character. He was a just man. Had it not been for this man of character, our world would be as lost as a "golf ball in high weeds". That's a phrase that our beloved pastor uses from time to time.