In a nutshell, rename htaccess.txt to .htaccess in your root forum directory. You may have to define the rewrite base in it (it is commented out) pointing to the base of your forum directory. Then select the friendly URL's option in the ACP.
# If you are having problems with the rewrite rules, remove the "#" from the
# line that begins "RewriteBase" below. You will also have to change the path
# of the rewrite to reflect the path to your XenForo installation.