If your PS4 controller won't charge, you can try swapping out the charging cable or checking the charging port.
You can connect your PlayStation 4 controller to your PC using a micro-USB cable or wirelessly via Bluetooth.