You can carry out the steps below:
Install the board's core via the Arduino IDE:
· Tools > Board > Boards Manager
· Search for "Arduino AVR Boards"
· From the drop-down menu select latest version
· Click "Install/update"
· Wait for installation to finish
· Click "Close" and restart your IDE.
. Plug your board back to the computer and select the board and port via tools.
- Use a data USB cable capable of some 480Mbps and do not use a USB hub.
- Remove anything wired to the board.
Step 2: ( Use this if step 1 above fails to solve the problem)
Put your board in bootloader mode by double tapping the rest button (one of the onboard LEDs will fade in and out slowly). While it is in this mode, upload an example sketch from the IDE, say BlinkLED into it, if upload is successful, then tap the rest button once afterwards to exit the bootloader mode.
Now upload the same sample code normally to the board without tapping the reset button, if successful, your board can now be programed with your own code normally.
Note: do not use your own code when the board is in bootloader mode.
If you have a clone board, see Arduino Uno R3 Clone CH340 / CH341 USB driver