This passage deals with how Jesus Christ was born and God’s intervention, through, an angel to keep Joseph from divorcing Mary.
Mary, a virgin, is found to be pregnant
Mary, soon to be the mother of Jesus Christ, was promised to Joseph as a wife but before they had consummated their marriage, she found out that she was pregnant. I assume that she told Joseph and him alone about this because in verse 19 the scriptures say that Joseph wanted to keep the matter secret. Nobody except the two of them knew about Mary’s pregnancy.
Joseph felt betrayed but the scriptures say that he was a righteous man. Deuteronomy 22:21 says, “Then they shall bring out the damsel to the door of her father’s house, and the men of her city shall stone her with stones that she die: because she hath wrought folly in Israel, to play the whore in her father’s house: so shalt thou put evil away from among you.” Not wanting this for Mary, Joseph was considering ending their engagement quietly.
The study of God’s word, rather than giving us a self-righteous attitude, should bring us to an awareness of how much we need God’s grace and mercy and this attitude should lead us to be quick to forgive others. You want to be truly righteous? Then heed the word of Ephesians 4:32. “Be kind to one another, tender-hearted, forgiving each other, just as God in Christ also has forgiven you.”
An angel visits Joseph in a dream and the prophecy of the Messiah’s virgin birth
God intervened by sending His angel to Joseph in a dream to explain that Mary had not betrayed him. She was pregnant by the Holy Spirit. The angel also told Joseph that the child would be a son who they were to name Jesus.
The scriptures go on to tell that things happened this way so that God’s prophecy regarding the Messiah would be fulfilled. The prophecy being referred to is one in Isaiah 7:14. “Therefore the Lord himself will give you a sign. Behold, the virgin shall conceive and bear a son, and shall call his name Immanuel.”
Joseph obey’s the word of God
The passage concludes by stating that when he woke up, Joseph, by faith, obeyed God’s word and took Mary as his wife. They did not consummate their marriage until she had delivered and they name the child Jesus.