There is this popular checklist that you should go through to solve your avrdude bugs.
Given that you are new to this thing , i suspect that it is because you dont have the correct drivers installed for your board. Assuming you have a CH340 chip , you can follow this tutorial (
https://learn.sparkfun.com/tutorials/ho ... rivers/all )
Solving AVRDUDE communication errors (Try these in order)
1. Is your Serial monitor open?
If it is, close it. this allows your IDE to upload sketches without conflicts with the Serial Monitor.
2. Have you selected the right port in your IDE?
You could have selected something that is not your Arduino. Change the port in the Arduino IDE by going into Tools -> Port.
3. Have you selected the right board in your IDE?
You need to select the right board and model.
4. Does the Power LED on your board light up?
If it does, unplug and re-plug your board, then check for blinking LEDs. If only the Power LED or no LEDs light up ask for further assistance (not for all boards).
5. Do you have a Nano or other Atmega 328p based board?
If so, try using the old bootloader. In the Arduino IDE Go to Tools -> Processor and select 328p(old bootloader). If your board doesn't have an Atmega 328p, you can skip this step.
6. Does your onboard LED blink when you press the reset button?
Try pressing the reset button on your Arduino, if the onboard LED doesn't blink when you reset, you probably have a broken bootloader, you can check out this tutorial on how to burn the bootloader.
7. Is anything connected to your Tx and Rx pins?
If there is, try removing everything connected to them.
8. Is this a problem on your computer's side?
This might be a problem on your computer's side, so try restarting your computer.
9. Are you running Linux?
If you are running Linux, try checking which groups you belong by using the groups command, then look at which group you need to be in with ls -l /dev/ttyACM*, ls -l /dev/S* or ls -ls /dev/USB* (replace the * with your port number), then use this command:- sudo usermod -a -G <group> <username> and add your user to the necessary groups.
10. Are your drivers installed?
Check your drivers, sometimes just reinstalling them works. If you are using a clone board, you might have the CH340 USB-Serial chip, which isn't supported by default. You can check by looking at your board and checking the SMD USB-Serial chip's name (not the big one). Click here to learn how to install CH340 Drivers. If you have an FTDI chip, This website will show you how to install their drivers. If you don't have either we recommend googling the USB-Serial chip that your board uses.
11. Is your cable faulty or capable of sending data?
Some USB cables arent capable of transferring data, and some may be faulty, so make sure to try a different one to see if it works!
12. Is this a problem with your IDE?
If you think that's the case, try reinstalling the IDE.