Connecting Arduino Mega With Esp-32

Hey guys, for a long time i am having confusio on connecting Esp32 with an arduino board,through serial communication

I want the Arduino to be Transmitter, but i notice that the Tx of Arduino is 5v which will fry the Esp32,so what do i need to do,in order to have a stable and smooth serial communication between these two boards.

Thankyou for your help !

A voltage divider with 1.2K on top and 2.2K on the bottom will do the trick. Mega Tx to the top of the 1.2K, ESP32 Rx from the middle, ground the bottom of the 2.2K to the common ground.