A problem when I run the code

When I run the code it gives me this error, how can I solve this

Arduino: 1.8.15 (Windows Store 1.8.49.0) (Windows 10), Board: "Arduino Uno"

Sketch uses 2226 bytes (6%) of program storage space. Maximum is 32256 bytes.

Global variables use 204 bytes (9%) of dynamic memory, leaving 1844 bytes for local variables. Maximum is 2048 bytes.

avrdude: ser_open(): can't open device "\.\COM3": The semaphore timeout period has expired.

Problem uploading to board. See Upload – Arduino Help Center for suggestions.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Here is your problem... The code can't be downloaded to the Arduino. Either because something else is using the port, it's the wrong port or something else with your connection is not right.

Go to "Tools"/"Port" and see to which port your arduino is connected and select that one (even if it's the same as before) and try again.

Did you follow the link to the upload troubleshooter and try the suggestions?

The only topic with a solution that I could find is arduino mega 2560 timeout communicating with programmer - #5 by raw201026. In that case it was a driver issue.

There are a few more articles on the web that seem to refer to other devices on your PC (e.g. bluetooth) or connected to your PC.