In case you're tearing your hair out (we've all been there!), the necessary code is below.
I'd suggest copying this into the Arduino IDE and hit the "verify" button (the first one with the tick). That'll compile the code but without uploading anything. It should work with no errors, and you don't even need a board plugged in to do this, so maybe unplug the Arduino for good measure.
If do you still get errors, then there's something wrong with your installation. Maybe try re-installing or download a fresh version, or even switch computer if you have that option.
Another thing you can try is "verifying/compiling" the BareMinimum sketch in file > examples > 01 basics. Again, there should be no compile errors (because there's no code to go wrong). Once you've confirmed that verfiy works, plug in the Arduino and try to upload (the second button with the arrow).
If you run into problems at this stage then there's something wrong with either your board, your cable or your setup. Try a different board if you have one, make sure you've selected the correct board in the first place, try different USB ports, and also try different USB cables. These are often an issue because some are just charger cables and don't carry data.
/* A simple program to sequentially turn on and turn off 3 LEDs */
int LED1 = 13;
int LED2 = 12;
int LED3 = 11;
void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
digitalWrite(LED1, HIGH); // turn on LED1
delay(200); // wait for 200ms
digitalWrite(LED2, HIGH); // turn on LED2
delay(200); // wait for 200ms
digitalWrite(LED3, HIGH); // turn on LED3
delay(200); // wait for 200ms
digitalWrite(LED1, LOW); // turn off LED1
delay(300); // wait for 300ms
digitalWrite(LED2, LOW); // turn off LED2
delay(300); // wait for 300ms
digitalWrite(LED3, LOW); // turn off LED3
delay(300); // wait for 300ms before running program all over again
}
void loop() {
// nothing in here because we only want to run the code once
}