The physics and chemistry of the interstellar medium