Back in history men usually took on the same jobs their fathers had. Because some ancestor had taken on the job of a carpenter in the past, Joseph was a carpenter.
If he’d been a rabbi, priest, farmer or fisherman he couldn’t have just left everything and gone to Egypt.
Because his family had gold, frankincense and myrrh they could live comfortably in Egypt, but if they needed more money Joseph could earn some as a carpenter with only a hammer, nails, and whatever was needed to cut wood. And he could easily take up his trade when the family returned to their home town.
Whatever ancestor had first become a carpenter certainly had no idea that his choice would influence the history of the world.