Serial Port Busy? (Beginner)

I just have a simple problem with a project that I am doing that involves moving a servo with an IR remote. Every time I try to upload the code I get "serial port busy". I assume this means I have code already on Arduino that is preventing the other from running but I don't know how to wipe/reset the Arduino.

#include <IRremote.h>
#include <Servo.h>
int IRpin = 11;  // pin for the IR sensor
IRrecv irrecv(IRpin);
decode_results results;
Servo myservo;
void setup()
{
 Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receiver
 myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
void loop() 
{
 if (irrecv.decode(&results)) 
   {
     irrecv.resume();   // Receive the next value
   }
  if (results.value == 33441975)  // change according to your IR remote button number
    {
      myservo.write(0);
      delay(15);
    }
    if (results.value == 33446055)  // change according  to your IR remote button number
    {
      myservo.write(30);
    delay(15);
    }
    
}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

The next uploaded sketch simply overwrites the existing one so nothing special to do there.

As for serial busy make sure you have NOTHING connected to D0 and D1 as they are used during the upload for most boards.

Could you also take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.

Reading those links will show you how to post code etc etc.

Hey, I was wondering if anyone knows how to deal with a busy serial port. I am trying to upload code but it would seem another code is already running on the Arduino. I keep getting the error message "E18-SerialPort Resource busy". I have tried wiping the Arduino but I keep running into the same problem. Please help thanks.

Pull the USB plug out and recinnect it. Activate the proper port for the download.

I tried this it gave me the same error message

@brayden1234, do not cross-post. Threads merged.

Make sure you are using the correct com port and no other program, like a terminal, is using the port.

In case you happened to overwrite the boot loader on the Arduino you have to burn a new boot loader before the board can be reprogrammed by USB.

DrDiettrich:
In case you happened to overwrite the boot loader on the Arduino you have to burn a new boot loader before the board can be reprogrammed by USB.

How would a beginner accomplish overwriting the bootloader? It's not something one can "accidentally" do.

Are you connecting with a terminal emulator like Putty? Unlike the serial monitor, Putty (or whatever terminal emulator) doesn't automatically disconnect when a sketch has to be uploaded.

OK cowboy, start by explaining what operating system you are using, whether you are using the Arduino IDE because that message sounds quite unfamiliar, what else you have connected to the PC and what projects you used on the Arduino before that did work, and what you have done in the interim.

In other words, provide information rather than "my widget does not work"!

Paul__B:
... whether you are using the Arduino IDE because that message sounds quite unfamiliar,

Open the Termite terminal program on the same COM port, and you will get this error every time.