To define a .php block class or a .phtml template that corresponds to a specific page area on your Magento 2 store you can use Template Path Hints.

Magento 2 Template Path Hilts

In order to enable template path hints in Magento 2 follow the steps:

1. Make sure your Magento 2 is in the default or developer mode.

2. Go to Admin Panel > Stores > Settings > Configuration > Advanced > Developer > Debug.

Magento 2 Template Path Hints

3. Check and configure Developer Client Restrictions.

Magento 2 Template Path Hints Client Restrictions

In this section set one or several IPs you want Template Path Hints to be available to. You can enable template path hints (next step), but still, you won't see them if in Allowed IPs there is some other IP entered.

This is done in case you want to look something up without disturbing other developers or customers since leaving this section empty will allow template path hints to everyone currently using the website.

4. Enable Template Path Hints.

Choose whether you want it to be enabled for StoreFront or Admin. Select Yes in the Add Block Names to Hints select box in case you want template path hints to show a block PHP class name additionally to PHTML template file path.

Magento 2 Template Path Hints Debug

5. Once you have finished don't forget to press the Save Config button.

Magento 2 Template Path Hints Save Config

6. Before using Template Path Hints we recommend you to make sure that Magento block cache, page cache are disabled.

 Now you are ready to reload a page to see which blocks on a page are referred to which PHP/PHTML files.