Add to the constructor in your class an instance of \Magento\Eav\Model\Config like this:
protected $eavConfig;
public function __construct(
...
\Magento\Eav\Model\Config $eavConfig,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
...
){
...
$this->eavConfig = $eavConfig;
$this->scopeConfig = $scopeConfig;
...
}
then you can use that in your class
$attribute_code_here = $this->scopeConfig->getValue('dev/debug/template_hints', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
$attribute = $this->eavConfig->getAttribute('catalog_product', $attribute_code_here);
$options = $attribute->getSource()->getAllOptions();