How can i fix this error?

#include <DHT.h>

#define Type DHT11
int sensePin = 2;
DHT HT(sensePin, Type);
float humidity;
float tempC;
float tempF;
int dt = 200;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
HT.begin();
delay(dt);
}

void loop() {
// put your main code here, to run repeatedly:
humidity = HT.readHumidity();
tempC = HT.readTemperature();
tempF = HT.readTemperature(true);

Serial.print("Humidity: ");
Serial.print(humidity);

Serial.print(" TempC: ");
Serial.print(tempC);

Serial.print(" TempF");
Serial.println(tempF);
delay(dt);
}

Im getting this error:
Sketch uses 5226 bytes (17%) of program storage space. Maximum is 30720 bytes.
Global variables use 257 bytes (12%) of dynamic memory, leaving 1791 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "\.\COM2": Access is denied.

Failed uploading: uploading error: exit status 1

when i restart my laptop and run the program it works for the first time then makes a sound then keeps giving me this error and i tried change the COM. Its telling me COM3 is being used so im not using that COM.

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

Unplug the Arduino, open the Device Manager and note which COM ports are present.

Plug in the Arduino and note the new port that appears in Device Manager. Select that port in the Arduino IDE and upload.

These instructions assume that you have already installed the com port driver for the programmer you are using.

from where do i install the com port driver, just checking incase i didnt

Follow the instructions in post #2, and then for whatever Arduino, programmer or interface you are using.