If you're working with XenForo, first tip would be that you should enable development mode, add the following to config.php and run php cmd.php xf-dev:export --addon XF:
PHP:
$config['development']['skipAddOns'] = [];
This allows the XF development output to be generated which will include individual files for templates and phrases.
If you're working with an add-on then it's similar but you don't need the skipAddOns thing, just export the development data for that add-on (this has to be done after the add-on is installed and up to date).