If you are using ESP-IDF and VS Code you will need to press "F1" and type "Arduino" and click on the option "add Arduino as component", you
- Press "F1"
- Type "Arduino"
- Click on the option "add Arduino as component"
You wait, and it will be installed. After the installation, it should compile correctly.