Error uploading sketch to Arduino UNO connected to ESP8266

If you have the ESP-01 module, you need to have its pins properly connected.
https://tttapa.github.io/ESP8266/Chap02%20-%20Hardware.html

In addition, you need a separate 3.3V power supply for it.