We know that the age of a star depends on its mass. Star formation is one of the hottest topics in Astronomy. It relates to the origin of planets and of life. The ISM is made up of both gas and dust.
Lets take the gas part first.
The ISM gas comes in different phases too. Space is pretty empty. Observing the ISM requires a tracer that emits light. In dense regions only long wavelength light can escape. Thus radio and IR are often the only way to see into dense clouds or across great distances.