Open Boards Manager from Tools > Board menu and search for "esp8266". Click the install button. Don’t forget to select your ESP8266 board from Tools > Board menu after installation (e.g NodeMCU 1.0) ...