First off, welcome to the forum!
Secondly, playing using the keyboard (in my humble opinion) suuuuuuuuuucks!
Before you can do anything with the controller, you will have to sync your PS4 controller with your PC so that it recognises it. It will not connect off the bat. There is a useful guide here: https://www.techradar.com/uk/how-to/gaming/how-to-use-the-ps4-dualshock-4-controller-on-a-pc-1309014 (although a quick Google will pull up stuff along similar lines and you might want to try and few and see which one works for you).
Then, once everything is synced, you will have to go into the "controller" settings in the relevant emulator you are using and simply assign the keys ("Click the button for A, B, C etc."). That is straightforward enough if you are using a standalone emulator such as Gens. If you are using Retroarch it is a little bit more complicated but there are videos on YouTube that deal with how to assign buttons etc.
Something to note (as I find this a pain in the ass), unless you have a spare PS4 controller that you will never use with the PS4 again (or only do so occasionally), you will have to keep resyncing the controller with the PS4 using the micro-USB lead every time you want to use it to play PS4 games. I only have 2 PS4 controllers, both of which I use all of the time, and it drove me nuts. I just ended up buying an XBox Series 1 pad for about £40 and use that instead.
Does that help?