Jesus was born in the town of Bethlehem in Judea, during the time when Herod was king. Soon afterward, some men who studied the stars came from the East to Jerusalem
and asked, "Where is the baby born to be the king of the Jews? We saw his star when it came up in the east, and we have come to worship him."
When King Herod heard about this, he was very upset, and so was everyone else in Jerusalem.
He called together all the chief priests and the teachers of the Law and asked them, "Where will the Messiah be born?"
"In the town of Bethlehem in Judea," they answered. "For this is what the prophet wrote:
"Bethlehem in the land of Judah, 1 you are by no means the least of the leading cities of Judah; for from you will come a leader who will guide my people Israel.' "
References for Matthew 2:6
So Herod called the visitors from the East to a secret meeting and found out from them the exact time the star had appeared.
Then he sent them to Bethlehem with these instructions: "Go and make a careful search for the child; and when you find him, let me know, so that I too may go and worship him."
And so they left, and on their way they saw the same star they had seen in the East. When they saw it, how happy they were, what joy was theirs! It went ahead of them until it stopped over the place where the child was.
They went into the house, and when they saw the child with his mother Mary, they knelt down and worshiped him. They brought out their gifts of gold, frankincense, and myrrh, and presented them to him.
Then they returned to their country by another road, since God had warned them in a dream not to go back to Herod.
After they had left, an angel of the Lord appeared in a dream to Joseph and said, "Herod will be looking for the child in order to kill him. So get up, take the child and his mother and escape to Egypt, and stay there until I tell you to leave."
Joseph got up, took the child and his mother, and left during the night for Egypt,
where he stayed until Herod died. This was done to make come true what the Lord had said through the prophet, "I called my Son out of Egypt." 2
References for Matthew 2:15
When Herod realized that the visitors from the East had tricked him, he was furious. He gave orders to kill all the boys in Bethlehem and its neighborhood who were two years old and younger - this was done in accordance with what he had learned from the visitors about the time when the star had appeared.
In this way what the prophet Jeremiah had said came true:
"A sound is heard in Ramah, 3 the sound of bitter weeping. Rachel is crying for her children; she refuses to be comforted, for they are dead."
References for Matthew 2:18
After Herod died, an angel of the Lord appeared in a dream to Joseph in Egypt
and said, "Get up, take the child and his mother, and go back to the land of Israel, because those who tried to kill the child are dead."
So Joseph got up, took the child and his mother, and went back to Israel.
But when Joseph heard that Archelaus had succeeded his father Herod as king of Judea, he was afraid to go there. He was given more instructions in a dream, so he went to the province of Galilee
and made his home in a town named Nazareth. And so what the prophets had said came true: "He will be called a Nazarene." 4
References for Matthew 2:23
2.23 Mk 1.24; Lk 2.39; Jn 1.45.