How do I get a block configuration value in a module? I created a custom block that contains a form field. 

This is my blockSubmit() method.

public function blockSubmit($form, FormStateInterface $form_state) {
    // Save our custom settings when the form is submitted.
    $this-&gt;setConfigurationValue('my_text_field', $form_state-&gt;getValue('my_text_field'));
} 


Now I want to access the my_text_field value from outside the custom block class.
You can load the block configuration entity, and get the settings.

$block = \Drupal\block\Entity\Block::load($block_id);
if ($block) {
  $settings = $block-&gt;get('settings');
  $my_text_field = $settings['my_text_field'];
}


$block_id is the machine name you see in the block layout when you save the block.

Edit: Store module configuration

If you want to store configuration for modules don't use a block form, but use a configuration form. Reference https://www.drupal.org/docs/8/api/configuration-api/working-with-configuration-forms
(see comment from @Berdir)

Dump all blocks and their settings

$blocks = \Drupal\block\Entity\Block::loadMultiple();
foreach ($blocks as $key =&gt; $block) {
  $settings = $block-&gt;get('settings');
  var_dump([$key =&gt; $settings]);
}