Mary, being a young girl was most likely living at home with her immediate family. The Bible doesn't specifically say, but it could have been Mary's father that had arranged the marriage, the entire aggreement might have been out of her control completely.
However, when Mary learned she was pregnant, she was betrothed to Joseph and not married. She must have wondered what the future would hold for her. And, when Joseph learned about Mary's pregnancy, he was unsure about what he should do. We tend to think of the betrothal between Joseph and Mary in much the same way as an engagement is today, but it was not the same thing.
A betrothal was just as binding as a marriage, especially when it came to the need for faithfulness. A bill of divorcement was just as necessary in a betrothal as an annulment would be in marriage. Scripture tells us in (Deuteronomy 22:23,24) that a betrothed woman was regarded as a wife, not a free woman and faithfulness was a requirement even before the union took place or she could be stoned to death.
We don't know exactly how or when Joseph found out about her pregnancy, but his first response was very "human" and very "religious" for that time as he was a devout Jew and an honorable man. Joseph's first thoughts were to back out of the marriage, however, he wanted to do it in a way that would spare Mary and her family the shame and humiliation.
Can you imagine what Mary must have felt?
Joseph, dismayed, but noble, was determined to take care of things quietly so Mary would not be disgraced. (Matthew 1:19-23) Then, while he was trying to figure a way out, he had a dream. God’s angel spoke in the dream: “Joseph, son of David, don’t hesitate to get married. Mary’s pregnancy is Spirit-conceived. God’s Holy Spirit has made her pregnant. She will bring a son to birth, and when she does, you, Joseph, will name him Jesus—‘God saves’—because he will save his people from their sins.”
Joseph had to have been a "great man of faith" for he believed, Joseph believed that an angel had "come to him in a dream!" Think about that for a moment, to believe a dream, if we remember... poor Zacharias had the angel appear to him in person at the temple and he wanted proof of what the angel said.
I wonder what any of us would do if an angel told us something in a dream, it is something to think about. I'm sure that Mary must have felt great relief when she learned from Joseph about his dream, and that he was still going to marry her!
Joseph did just as he was told, what a great trust in God, he must have had!! We are also told in Matthew 1:25 that Joseph had no union with Mary, until after she gave birth to Jesus, thus confirming that it was a virgin birth and Joseph was a man of true honor and respect!
Joseph was a man who God knew He could trust to instantly obey His voice, he didn't need signs from heaven and he wouldn't wait for more confirmation from God, "NO" Joseph would just obey. What a great example this is to us, when God calls one of us to do work for him... we need not always look for signs or confirmations, nor should we get puffed up and think we've arrived spiritually! In Christ Jesus we are all sufficient and we just need to obey!
Are you and I ready and willing to obey what God says we should do? Sometimes it takes a great leap of faith, just remember God is already there to be our help and to be our stay. Ours is just to trust and obey!