Cant upload program to arduino

Hey there, im trying to make a basic bluetooth code using serial ports to my arduino uno but its impossible for me to upload it. Im using the correct port and i've looked up a lot of problems trying to reset the board but i cant. He're is the code:

#include <Servo.h>

Servo myservo;
int pin = 11;
int state = 0;

void setup(){
  myservo.attach(pin);
  Serial.begin(9600);
  
}

void loop(){
  if(Serial.available()){
    state = Serial.read();
  }
  myservo.write(45);
  delay(1000);
  if(state == 'O'){
    myservo.write(180);
    delay(500);
  }
}

Any ideas?

(deleted)

Actually the problem is that i got it conected, the only problem its that the program dont get uploaded to the board, it sticks a lot of time in uploading, and then fails. :confused:

(deleted)

Im sorry, forgot i must disconect serial pins, really thank you :]