Chemistry plays a crucial role in astrophysics by providing insights into the composition, formation, and evolution of celestial bodies. Understanding the chemical makeup of stars, planets, and interstellar space helps us comprehend various astrophysical phenomena. For instance, the study of spectral lines allows us to determine the elements present in stars and galaxies.