Arduino Codes not Uploading

When i tried to upload the code it says the following error (same appears for BareMinimum code):
Arduino: 1.8.3 (Windows 10), Board: “Arduino/Genuino Uno”

Archiving built core (caching) in: C:\Users\ANISHG~1\AppData\Local\Temp\arduino_cache_129790\core\core_arduino_avr_uno_4f102434c573a4283b83ba95af927dff.a
Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 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 http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

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

I have uploaded several codes in arduino before and they worked but it’s the first time this has happened. I checked port from device manager and its COM3 my arduino is updated and i also tried restarting my pc and changing arduino usb cable but nothing works…

USB cables can and do go bad without warning.
USB 3.0 ports can cause issues.
Items connected to pins 0 & 1 can cause upload issues.
Too many power hungry items connected to a board can also cause issues.
If its a newer REAL arduino the USB chip can be easily damaged by over-voltage and short circuits.