Get a ROM to test the gamepad - like https://www.psx-place.com/resources/padtest.396/ for PS1 - and run it under RetroArch to test your inputs.
EDIT: outside am emulator, you can use the jstest utility to test the connection/input response with your controller. You'll have to exit EmulationStation and run it from the command line like so:
jstest /dev/input/js0To finish the test and get back to EmulationStation, use Ctrl+C (this will close the jstest session) and type emulationstation (+ enter) to start EmulationStation again.