How to use sleep modes on Uno R4 WiFi

So I know the ESP32 on board has both light sleep and deep sleep modes, but I don't know how to access them.
Arduino won't recognize these commands from Espressif docs

  esp_sleep_enable_timer_wakeup(SLEEP_TIME * 1000000);
  esp_light_sleep_start();

I just want to go to sleep and wake up after a set time, how do I write that?

Yes I would also want to put that to sleep. I'm pretty much trying to minimize current consumption during waiting periods.

For the record, I ended up switched to an UnexpectedMaker Feather S3 with an ESP32 on board, and it worked seamlessly with my existing arduino code and allowed for use of deep sleep and esp-now communication.