He went there to register with Mary, who was pledged to be married to him and was expecting a child. Luke 2:5
It all started when Mary was sweeping the floor. There she was, when out of nowhere an angel of the Lord appeared! Mary gasped, she had never seen anything so bright and reassuring, but powerful and intimidating at the same time. The angel told her, “You have been chosen by the Most High to be the one to give birth to the Saviour of the world. You will have a baby, and you must name him Jesus.”
Mary was shocked, for many reasons. “How is this possible? I am a virgin and am going to be married to Joseph.”
But the angel replied, “Continue to trust in God. It is for that exact reason that you were chosen.” And then, as soon as he had come, the angel was gone.
Joseph tossed and turned in his bed. He thought that Mary must be hiding something from him. For one thing, she was pregnant, and he did not know why. He was supposed to be engaged to her, but now that was all over. When he finally fell asleep, an angel appeared to him in his dream. The angel told him that Mary was telling the truth, she was a chosen one of God, and that marrying her was the right decision! When Joseph woke up, he was certain of what to do. He ran and woke up Mary, and told her all the angel had told him.
As Mary and Joseph approached Bethlehem, they saw that it was very crowded. They found the guest room to be full and were led to sheltered space near where the animals were kept. At this time Mary was almost ready to have the baby, so they knew this was their only option. Joseph made a bed of hay in the corner for himself and his wife. Soon, the child was born. They wrapped Him in cloths and placed Him in the manger. And there, in the soft light of the stars from above, they witnessed the Son of God. The one who would save the world.