The advent of ALMA, with its unprecedented sensitivity, makes it possible the detection of far-infrared (FIR) metal cooling lines from the first galaxies that formed after the Big Bang. These lines represent a powerful tool to shed light on the physical properties of the interstellar medium (ISM) in high redshift sources. In this talk I will present a theoretical model that, for the first time, allows to describe the distribution of the ISM neutral phase inside high redshift galaxies, and to predict the luminosity of several FIR metal cooling lines arising from it. The model is based on high resolution radiative transfer cosmological simulations, further implemented with sub-grid prescriptions to account for the cooling and the heating processes taking place in the ISM. I will show how the model has been successfully tested against recent ALMA [CII] 158 micron detections, and how the comparison can be used to put constraints on the metallicity of high redshift galaxies.