Cold gas is considered a requirement for star formation and galaxy formation, in both cases, to have cooled sufficiently to allow a sufficiently high density.
Galaxies are thought to form from gas cooled from 104 K and much more, to the range 103 K, the cooling resulting from the instigation of electromagnetic radiation.
Within galaxies, stars are thought to form from gas (interstellar medium) cooled to room temperature and below, even to 10 K, temperatures at which ionization and dissociation are insufficient to prevent the gas from becoming neutral and molecular, forming molecular clouds. Cold gas can be the result of the cooling of hot gas from stars, or can accumulate in the galaxy through accretion from the intergalactic medium. Such accretion is thought to be one means of triggering a high star formation rate in a galaxy. Cold gas's presence is expected in starburst galaxies.
In both cases, there are challenges to detecting the gas, as the thermal emission is low and at long wavelengths, and few spectral lines are detectable. The 21cm line, and tracers of molecular gas such as carbon monoxide lines are used. Also, detection of somewhat-less cold gas can be taken as evidence there may be nearby gas has cooled even more.