Please help me understand this code

yes - try a web search for ESP32 Arduino, e.g. ESP32 getting_started and installing-the-esp32-board-in-arduino-ide-windows-instructions

after installing the ESP32 click Tools>Board select ESP32 then the specific board, e.g.