The engineers who designed those pieces of machinery selected special heat-resistant materials to be used in them. For example, high-temperature furnaces used to melt metals like steel are lined with refractory brick which has a melting point comfortably higher than any of the metals intended to be melted in it.
Furthermore, the tools used to shape pieces of glowing-hot metal consist themselves of metal which, because of its alloying constituents, retains near full strength at red-hot temperatures. That class of metals are called high-speed tool steels or superalloys and typically consist of iron with large amounts of chromium and nickel and other metals.
Such alloys are also used to make things like gas turbine blades used in jet engines and power plants.
Where suitably heat-resistant materials are not available, engineers include cooling mechanisms in their tool designs. For example, in induction furnaces in which the heat source is eddy currents induced in the metal to be melted, the induction coils must be made of copper to minimize their self-heating, and since the copper would be subject to melting, the copper coils are hollow and have water being pumped through them while in operation.