First things first, get a USB cable. Here, any USB 2.0 Micro-B cable will work, however, your controller should have come with a cable packed in it.
How To Pair A PS4 Controller
Now plug in the USB cable into your controller and then into the USB port of your Playstation 4. Next turn on your PS4 and it will connect automatically to the controller.
Next up, press the PlayStation button located at the center of the controller to turn it on.
Your PlayStation 4 should now display the login screen where you will choose the player you want paired with that controller.
Always ensure that the controller is charged otherwise you will have pairing challenges.
To unpair it, ensure that it is turned off and then use another PS4 controller to power on your console.
Access the PS4 Home menu and go to Settings. On the displayed menu, open Bluetooth devices under the Devices option.
You will now see a list of controllers paired with your PS4. Choose the one you want to unpair and tap on Delete.