Hallo,
https://docs.espressif.com/projects/arduino-esp32/en/latest/api/wifi.html?highlight=wifi%20off#disconnect