Making semiconductor electronic components is a whole subfield of engineering... sophisticated methods have been developed over the past several decades for creating vast arrays of microscopic doped devices on chips. The fact that semiconductors exist in the solid state at room temperature, and are stable, is very helpful for making them into tiny, robust devices.