Sketch Upload explanation for multiple sensors

Hi,

I'm completely new to Arduino.
What I'm seeking is a very high level overview of "how would I do this".

Problem Proposal

Take this example:

I have an Arduino uno, breadboard, ESP8266 01 using a LLC and an ultrasonic sensor.
As you can imagine I would like to send Ultrasonic data 'somewhere' using my ESP.

The Sketch Confusion

Lets say I have all the above wired up. What I don't understand is the sketch upload part.
I've seen some tutorials using the Arduino IDE where you have to select ESP as a board and then upload.
I've seen other tutorials where you select Arduino Uno as a board and then upload.

So I'm confused about what goes where.

Can I write my ESP code and UltraSonic code all in one sketch file? If so what board do I select to upload (ESP Or Uno).

Apologies if this sounds absurdly Naive. I've done a lot of searching but I just cant seem to put 2 & 2 together.
I'd appreciate if somebody could spell this out for me (the principles at a high level).

Thanks for readig

There are 2 ways to use an esp with Arduino. One is to use the esp as a WiFi module for an Arduino like an Uno. The Arduino sends "AT" commands to the esp over serial lines.

The second way is to use an esp instead of an Arduino.

The esp can be programmed directly with the Arduino IDE. It is a much more powerful and capable processor than an Uno, but an esp-01 is hampered by having so few pins.

It's much easier and better to get an esp development board. I recommend Wemos Mini.

Thanks for the alternative advice.

I'll definitely consider it if solution 'A' becomes too difficult but I've already got all my equipment and I'm hesitant to abandon getting it working so early on because I don't understand a basic concept properly.

If you're interested this is what I'm trying to duplicate (with the addition of Ultrasonic)

Esp8266-01-sample

It looks really cool which is why I'm so keen on getting option 'A' working .