The word "razor" is a metaphor for the king of Assyria and his army, and Yahweh speaks of the king as if the king were a man who would do Yahweh's work and then receive money from Yahweh. Alternate translation: "the Lord will call the king of Assyria from beyond the Euphrates River to work for him to shave you" (See: [[rc://en/ta/man/jit/figs-metaphor]])
# the head ... the hair of the legs ... also ... the beard
It was bad to have someone shave the top of the head; it was worse to have someone shave "the hair of the legs"; it was worst of all to have someone shave the beard.
Isaiah does not say whose head, hair, and beard the Lord is going to shave, but Ahaz and the reader would understand that this is a man; the man is a metaphor for the people living in the land of Judah. (See: [[rc://en/ta/man/jit/figs-metaphor]])
Possible meanings are 1) this is a polite way to speak of the hair on the lower body or 2) this speaks of the hair on the legs. (See: [[rc://en/ta/man/jit/figs-euphemism]])