Magento experts techniques are as follows.
Lets say my custom file path is
app/design/frontend/{Package}/{theme}/Magento_Theme/templates/html/test.phtml
calling in xml layout file
<block class=”Magento\Framework\View\Element\Template” name=”test_file” template=”Magento_Theme::html/test.phtml”/>
Calling in blocks and cms pages
{{block class=”Magento\Framework\View\Element\Template” name=”test_file” template=”Magento_Theme::html/test.phtml”}}
Calling in any phtml file
<?php echo $this->getLayout()->createBlock(“Magento\Framework\View\Element\Template”)->setTemplate(“Magento_Theme::html/test.phtml”)->toHtml();?>