This is a tricky one, mainly because from what you describe it seems like one of the buttons on your controller is stuck and it's overriding the rest.
But before addressing that, you can try a few things first:
- Completely turn off your console (not rest mode), wait a few minutes and turn it back on.
- Reset the controller by sticking an unfolded paper clip in the small hole on the back of the controller. You can check Step 3 on DS4 troubleshooting guide
- Launch a game, when in-game, turn off the controller (hold middle button > Adjust devices > turn off controller) and then turn it back on.
If the above don't work, there's a good chance that a button is stuck on the controller and is blocking the rest of the buttons to work properly.
You can check this by connecting the DS4 controller to a computer the USB cable, the drivers should be installed easily on their own and then check the controller's properties. Windows have a screen which shows which buttons are pressed. If you have a button stuck it should show up as pressed all the time.
If you can confirm that the button is stuck, then you need to clean it.
On a Reddit thread I was reading, someone said that they smacked the controller against their thigh a couple of times and the controller worked fine afterwards. For the record, I don't take any responsibility if you break your controller.
There are several ways to clean it, like compressed air or taking it apart completely. You can check this Reddit post about dealing with a stuck button.