I want to power ESP32 with 230V AC and I don’t know how to do it. The requirement is that it must never overheat. What components should i use? The ESP will be in small space with no airflow. Will it be even possible?
The folks over at Random Nerd Tutorials offer a solution for this exact scenario using a HLK-PM03 Hi-Link 100-240V AC to 3.3V 1A DC converter. They add electrical and thermal fuses to mitigate some of the possible failure modes of over-temperature or over-current.
The specifications of the HLK-PM03 are here. I suspect there will be a few alternatives available that do a similar function.
My suggestion is to be hyper-aware of the safety issues of dealing with mains power, and to be realistic about your own capabilities.