I made a small little IoT device to control my light chains from my phone, I'm using a MOSFET to turn the power on or off, using an esp32 connected to the MOSFET, both esp32 and light chain is supplied from a standard 6v phone charger I just clipped the wires and used it,
I have a voltage regulator on the esp32 as seen on the image, when I run the system the esp32 slowly heats up to around 40-50 Celcius, and I can hear a small whinny sound from the chip, the esp32 is getting 3.3v as I should when I measure with a multimeter
what's wrong?
(btw it works with turning lights on and off, not sure if those was the resisters i used)

