This can be tricky, depending on the make/model of your gamepad.
What worked for me:
Turn on Bluetooth on the computer. Put controller in “pairing mode” and connect it with the computer. (mine came up as 'Pro Controller').
In order for it to work with x3 (and other gamepad enabled games), you need an adapter or a 'helper app'. I used a utility called
BetterJoy. Follow the instructions on how to install this and make sure it is running before launching your game.
This works extremely well, but I did have to make some adjustments in the x3 Controls to set it up the way I wanted it to be, but once I saved the profile – it was all go from there!