If you have a wired xbox controller its as simple as plugging it into a USB slot on your computer.
If you have a ps3 or ps4 controller, attach the charging cable, plug it into USB in your PC. Find a driver; The "MotionInJoy" driver is probably your 'best' option, even if the software is sketchy in my opinion.