Noob wiring/software help for esp8266

the code the guy made above? i believe d4 corresponds with gpio 2 which is why hes writes in the code input pin =2? i dont know