The first half shows the the fulfilling of prophecy in the lineage of Christ and importance of family history in our lives.
In verse 19 Joseph sees an angel and is told that it is ok to take Mary to be his wife because Christ was conceived by God. Normally in those days if a someone was caught in adultery they were publicly stoned to death. It would have been easy for him to make assumptions. Especially since Mary was pregnant and he hadn’t married her yet. The logical explanation would be that she committed adultery. But he was willing to listen and the angel explained the situation. The angel also tells Joseph to name the baby Jesus.