Matthew 2:13-23 CSB
After they were gone, an angel of the Lord appeared to Joseph in a dream, saying, “Get up! Take the child and his mother, flee to Egypt, and stay there until I tell you. For Herod is about to search for the child to kill him.” So he got up, took the child and his mother during the night, and escaped to Egypt. He stayed there until Herod’s death, so that what was spoken by the Lord through the prophet might be fulfilled: Out of Egypt I called my Son.
Then Herod, when he realized that he had been outwitted by the wise men, flew into a rage. He gave orders to massacre all the boys in and around Bethlehem who were two years old and under, in keeping with the time he had learned from the wise men. Then what was spoken through Jeremiah the prophet was fulfilled:
A voice was heard in Ramah,
weeping, and great mourning,
Rachel weeping for her children;
and she refused to be consoled,
because they are no more.
After Herod died, an angel of the Lord appeared in a dream to Joseph in Egypt, saying, “Get up, take the child and his mother, and go to the land of Israel, because those who intended to kill the child are dead.” So he got up, took the child and his mother, and entered the land of Israel. But when he heard that Archelaus was ruling over Judea in place of his father Herod, he was afraid to go there. And being warned in a dream, he withdrew to the region of Galilee. Then he went and settled in a town called Nazareth to fulfill what was spoken through the prophets, that he would be called a Nazarene.
CSB: Christian Standard Bible