The book of Mathew begins with the genealogy leading from Abraham all the way to the coming Messiah.
The chapter then reveals that Mary was betrothed to Joseph, but before she was with him she became pregnant by the Holy Spirit. Joseph, being a righteous man didn't want to expose her publicly, because for this offense in that time she could have gotten stoned. So he planned on sending her away secretly to have the baby and secretly divorcing her.
After he considered this plan, an angel of the Lord appeared and told him that Mary was pregnant by the Holy Spirit and that this baby was going to save men from sin and his name shall be Jesus, “The Lord is salvation”. All of this was said to fulﬁll the prophecy of what Isaiah had said in Is 7:14. :Behold, the Virgin shall be with cild and give both to a son, and they shall call his name Immanuel,” which translated means “God is with us”.
Joseph awoke from his sleep and did as the angel had said, and he ofﬁcially took Mary as his wife, but he kept her a virgin till she gave birth to the baby, Jesus.
It took Joseph much strength and boldness to follow what he was commanded. Following through with this was taking on social discomfort and judgment from everyone around. When we feel God guiding us to do something, no matter how uncomfortable it is to obey or how much backlash we will get from others in “society” its important to pray for strength and obey. God sees when we deal with public scrutiny to obey his word, and He will help us through that time, but its one good way for us to show Him our love and appreciation.