How to check config setting in custom service class with dependency injection?
Make sure you inject config.factory and then you need to use:
$this-&gt;config
  -&gt;get('my_custom_module.settings')
  -&gt;get('display_debugging_info');

You can see that Drupal::config() is:
public static function config($name) {
  return static::getContainer()
    -&gt;get('config.factory')
    -&gt;get($name);
}

So after injecting your service, the equivalent of \Drupal::config('my_custom_module.settings') is:
$this-&gt;config-&gt;get('my_custom_module.settings');