God called Abraham to travel to another place that he promised to give him. Abraham did not know where that other place was. But he obeyed God and started traveling because he had faith.
But he heard that Archelaus was now king in Judea. Archelaus became king when his father Herod died. So Joseph was afraid to go there. Then, after being warned in a dream, he went away to the area of Galilee.