Modeling Ionized And Molecular Regions Of The Interstellar Medium Using The Spectral Synthesis Code Cloudy