You need to say which model of Arduino you have (Uno) where you bought it from , which type of computer you have , where you downloaded the software from and which version it is .
Also how did you up load ? Using arrow on the tab. ?
@samstrass , looking at the brief information provided, your sketch is compiling correctly, but it seems that there is a problem with the IDE (actually avrdude) communicating with your Arduino.
Sorry, I'm new to this.
I got it from an Egeloo kit (UNO R3). I have a windows 11 computer (built), I downloaded software off the arduino website (v1.8.19) and I'm using the upload button on the top of the window (below the toolbar).