Let's list a few common errors.
If you face this problem, then check the A to B cable is properly connected to both the Arduino and the computer. You can also check if the USB port is broken or if the Arduino's port is working.
If both the connections are good, then there might be the problem with the Arduino IDE installation. Just remove the Arduino IDE and reinstall the software again.
There are a number of things that are responsible for this kind of error. They include: the drivers for the board, the board and serial port selections in the Arduino IDE, access to the serial port, the physical connection to the board and more. Here are some specific suggestions for troubleshooting the problems.