Connect ESP8266 ESP-01 with Arduino

Hello
I want to inquire about connecting Arduino with esp8266 using serial communication RX TX (Master - Slave)
I want to know how write the code esp?
Is the same code that I type in Arduino Slave?
The physical connection will be between Rx, Tx h, or via SCL, SDA?
Can you help me?

I want to know how write the code esp?

Is that a question or a statement?

As written, you seem to want us to guess what the answer to that question is. That doesn't make sense.

Is the same code that I type in Arduino Slave?

Obviously not. The master and the slave are going to have quite different code.

The physical connection will be between Rx, Tx h, or via SCL, SDA?

You communicate between the Arduino and the ESP using SoftwareSerial on any two available (Arduino) pins.