You can try these things-
1)Check with other cable(a faulty cable can't connect to PC)
2)Install Samsung USB drivers in PC and check issue-
3)Restart Phone and check issue.
4)Try to connect to some other USB ports in PC.
5)Try to connect some other phone with same cable with PC, if working with other phone then it might be issue with your phone.
6)Check this setting>Developer mode>Default USB connection>Transferring files.