Node-Red ESP32 comms

If you need a prototype (including wifi, mqtt and home convention) perhaps you take a look at my Christmas project.

The code for controlling 3 gpios (with pwm) is only a few lines. All the protocol stuff is done by the great homie esp8266/32 library.
If you start perhaps consider to skip the Arduino IDE and take a look at vs-code + platformio. Looks more complex on first sight but all the coding tools are great especially for beginners.
Don’t get confused: Arduino IDE is using the Arduino Framework. With platformio you “can” use the Arduino Framework too only with the more powerful vs-code ide.