Most likely issue is the USB cable - try a different one.
If that's not the issue, it could be MTP was unselected and needs to be turned back on (in vanilla Android: Settings .. Storage .. Menu .. USB computer connection).
If that's not it, then it will be drivers:
- disconnect the phone from the computer
- uninstall ALL phone related sofware and drivers from the computer
- restart the computer
- restart the phone
If your phone came with PC software, install this - do NOT connect the phone until prompted
If your phone did not come with PC software, connect it to the computer
In both cases, do NOT disconnect the phone until ALL drivers have successfully installed