New International Version (NIV)
18 This is how the birth of Jesus the Messiah came about[a]: His mother Mary was pledged to be married to Joseph, but before they came together, she was found to be pregnant through the Holy Spirit. 19 Because Joseph her husband was faithful to the law, and yet[b] did not want to expose her to public disgrace, he had in mind to divorce her quietly.
20 But after he had considered this, an angel of the Lord appeared to him in a dream and said, “Joseph son of David, do not be afraid to take Mary home as your wife, because what is conceived in her is from the Holy Spirit. 21 She will give birth to a son, and you are to give him the name Jesus,[c] because he will save his people from their sins.”
22 All this took place to fulfill what the Lord had said through the prophet: 23 “The virgin will conceive and give birth to a son, and they will call him Immanuel”[d] (which means “God with us”).
24 When Joseph woke up, he did what the angel of the Lord had commanded him and took Mary home as his wife. 25 But he did not consummate their marriage until she gave birth to a son. And he gave him the name Jesus.
Can you imagine the thoughts that were going through Joseph’s mind. How can I marry Mary if she is with child? Why is this happening to me? This is so horrible and I think I need to divorce Mary quietly. He probably thought about the situation a lot and perhaps lost sleep over this. I imagine he had much anxiety in regard to this. Luckily the angel came to Joseph and explained what he was to do. Joseph believed and decided to do as the angel told him and he married Mary after all. How would the story be different if Joseph was not a man of faith and decided to divorce Mary? Jesus would be born without an Earthly step-father. Luckily, Joseph had the courage to do the right thing although he did not fully understand everything. May we be able to listen to the Lord and obey even when we cannot comprehend everything that is going on at the time.