You can use the USB-to-Serial adapter of the Arduino UNO, it has one on-board (ATmega16U2). Check the schematic of the UNO to understand what's going on.
First, upload an empty sketch to the UNO's ATmega328P, to make sure that it doesn't use the UART.
Connect the TX pin of the ATmega16U2 (i.e. the RX pin of the Arduino, digital pin 0) to the RX pin of the ESP8266. Connect a 2kΩ resistor between the ESP's RX pin. Together with the 1kΩ resistor on the ATmega16U2's TX line (on the Arduino), this creates a voltage divider that acts as a level shifter from 5V to 3.3V.
Connect the RX pin of the ATmega16U2 (i.e. the TX pin of the Arduino, digital pin 1) to the TX pin of the ESP8266.
Connect the grounds together as well.
In the Arduino IDE, select the ESP8266 under Tools > Board. Then enter programming mode on the ESP:
- Bring reset low
- Bring GPIO0 low
- Bring reset high
- Bring GPIO0 high
Then upload your sketch to the ESP.
I recommend adding simple push buttons and pull-up resistors:
(The ESP-01 has GPIO15 shorted to ground internally, so you don't have to worry about that. If you were using an ESP-## module that breaks out this pin, you need an external pull-down resistor.)
Keep in mind that you will also need a decent 3.3V power source, and some decoupling capacitors.
A Beginner's Guide to the ESP8266