I don't know how to set the PWM resolution and frequency

I want to make PMW 12bit, 12kHz with Arduino Nano ESP32
ArduinoNanoESP32でPMWを12bit,12kHzにしたい

Have you looked at the sample sketches in any of the PWM libraries? That is where most people start learning.