Updating Code via internet without any USB or Serial Interface is called as “Over The Air” or OTA. OTA is very simple when it comes to implement using Arduino IDE.
Step 1: ESP8266 OTA Example Arduino Code Tutorial
There are simple six steps involved in OTA of ESP8266.
1. Connect ESP8266 to Arduino IDE using USB or Serial
2. Upload OTA code
3. Connect to wifi network
4. Choose wifi port in arduino
5. Remove USB or Serial From esp8266
6. Upload New Code over the air.
Complete Step By Step Tutorial Can be found Here >>> https://www.myelectronicslab.com/iot/esp8266-ota-example-arduino-code-tutorial-air-update/