How do I make ESP01 to run with the code in it after turning it off and on?

When I worked with Arduino board, as soon as supply it with power, it runs the code in it from the start. But what I noticed was that with ESP01 connected to Arduino board, that is not the case and it just doesn't do anything at all. I, for now, am uploading the code every time I turn it off and on, but is there anything I can do to make ESP01 to run the code when I turn it on?

is there anything I can do to make ESP01 to run the code when I turn it on?

It should do that automatically. If it doesn't, I suspect that the problem is that you are not supplying it adequate power. By connecting a USB cable, to program it, you provide it adequate power.

How IS the ESP01 powered?

PaulS:
It should do that automatically. If it doesn't, I suspect that the problem is that you are not supplying it adequate power. By connecting a USB cable, to program it, you provide it adequate power.

How IS the ESP01 powered?

ESP01 is connected to the Arduino's 3.3V and GND, and the Arduino board is connected to my laptop through USB cable. There are multiple other bits connected to the board such as Servo motor, would that affect it?

HerO_0110:
ESP01 is connected to the Arduino's 3.3V and GND, and the Arduino board is connected to my laptop through USB cable. There are multiple other bits connected to the board such as Servo motor, would that affect it?

The Arduino 3.3V usually cannot supply enough current to run the ESP01 with its WiFi turned on.
Connected devices can also affect the ESP01. As an example, if GPIO0 is pulled to GND on power up the ESP8266 will go into bootloader mode waiting for a new sketch to be uploaded.

Riva:
Connected devices can also affect the ESP01. As an example, if GPIO0 is pulled to GND on power up the ESP8266 will go into bootloader mode waiting for a new sketch to be uploaded.

Not quite what I meant, but THANK YOU SO MUCH for mentioning that, that actually fixed it. Cheers mate.