You need proper USB driver installed on your PC to be able to connect your Xperia X to PC (as also Xperia X performance and Xperia XA). Otherwise, you cannot transfer files between the device and PC, let alone use ADB or fastboot to flash a firmware.

Sony provides drivers for all its device — it’s pity one driver files doesn’t work for all of its Android devices, which is the case with other OEMs like HTC, Samsung, LG, etc.

BTW, if you are looking to work with ADB and fastboot, then use this link to install ADB Driver first.

→ Download the Windows USB driver for Xperia X, XA, X Performance.

Do let us know if you need any help in this regard.