Serial Monitor not working with ESP8266

If the sketch works for as long as you don’t open the serial monitor, but stops the moment you open it, hen you have misconfigured DTR/RTS lines and that causes the chip to held in reset.

Please try all available combinations from here.