Here I am going to describe what is mentioned in the title!!!
Sometimes your android device may not be connected to your PC as you expected. There are many reasons for that. Ex: device driver is not available in your PC, USB problem or any other system error.
I will describe a few methods that could fix this issue.
Option 1:
Simply restart your android device. Remember you must disconnect it from PC while the device is restarting. Then reconnect to the PC.
Option 2:
Go to Control Panel -> View Devices and Printers check whether your device is available there. If it is visible on the other devices/unspecified section then that means your device driver has a problem.
Right click on device icon and troubleshoot, if the troubleshooter find the problem apply fixing as usual. If the troubleshooter cannot fix the problem, right click on MyComputer on desktop -> Properties -> Device Manager.
There you will find your device with a yellow warning mark on it . Simply disable the device by right clicking on it. (Don't be afraid!!) . Disconnect your device. Restart your PC. Reconnect and check if the device is working.
Option 3:
Still the device is not connecting, go to Device Manager, right click on your device apply Update driver.
1.Try automatic update first.
2. If not working, try on 'Let me pick from a list of device drivers' and check for compatible drivers, If the appropriate driver from your phone manufacturer is there try update it.
3.If not working, download the driver to PC and manually select the driver by browsing.
To ensure the correct USB connection,
go to USB controllers on device manager, check for the USB driver with
your phone name. Go to properties by right clicking on it, if it
indicates the device is working properly ignore it.
If not try updating the driver similar to mentioned lines above.
Option 4:(Risky)
Try to find a device driver updater app on playstore for your device. If found, update the driver in your android device.
Uninstall device from your PC by right click on device icon with warning at device manager.
Disconnect the device.
Restart the PC.
Reconnect the device.
Option 5:
Ask for someone with knowledge on fixing this.
Or
Backup your data to some account, restore to the factory settings.