In the last 50 years, almost 200 molecules have been detected in space. Some of them, such as carbon monoxide (CO), water (H$_2$O) and ammonia (NH$_3$) are very simple, but others are formed by more than 10 atoms. The astrochemistry field in astrophysics aims to investigate the chemistry of space by means of observations, laboratory experiments as well as theoretical studies. In particular, molecules represent a promising way to follow the cycle of the interstellar medium (ISM) from the diffuse gas to the dense and cold clouds to the protostellar phases, with the ambitious goal to understand how and where molecules of biological interest are formed. In my talk, I will try to show the diagnostic power of molecular emissions at centimeter and millimeter wavelengths and to illustrate how to derive important information about the dynamic state of the ISM. My recent work is in particular focused on the analysis of the kinematics of a protostellar clump, Barnard 59, located in the Pipe nebula.