Simple way how to reboot ESP32 in Arduino or PlatformIO
Just use
ESP.restart();
This will immediately reboot the ESP32 controller
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow