ESP32 max input voltage UART
You should use a level converter (also called level shifter) from 3.3V to 5V (and around). These devices are bi-directional.

You connect:


3.3V to the LV (Low voltage) pin
5V to the HV (High Voltage) pin
RX of the ESP to A0, A1, A2 or A3, e.g. A0
TX of the ESP to A0, A1, A2 or A3, e.g. A1
RX of the Arduino opposite of the TX of the ESP, e.g. B0
TX of the Arduino opposite of the RX of the ESP, e.g. B1
Connect the GNDs, for clearity better put them on the same row (ESP next to A4, Arduino next to B4).


See bi-directionional-logic-level-converter-hookup-guide for more details.