Disconnect everything from the board and try to upload the code, with just the Uno connected to the USB cable. If the error still persists, check that you have Uno selected as the board, correct serial port, see if the LEDs blink on the UNO when you try to upload the code. If the LEDs do not blink, then it’s either the cable or the serial port. If the LEDs blink and you still get the same error, it’s the microcontroller, either the bootloader is corrupted, or the micro was fried somehow.