Magento 2 how to get custom attribute title and its value in phtml file.
As per your comments, I assume that you are getting the product object.
$attribute = $_product->getResource()->getAttribute('attribute_code');
This will give the attribute object, where
attribute_code is the attribute code.
then use the following code to get the value of attribute for current product:
and use below code to get the name (label) of the attribute:
Go to :
find your attribute and click to open edit page and select "Storefront Properties"
And from there "Allow HTML Tags on Storefront" select to Yes.
Then on your template you can get value by $product->getYourAttributeCode()
NOTE : if your attribute is like custom_attribute then your method will be like $product->getCustomAttribute();