How can I add a new field from config inside hook_update_N? I have to add taxonomy by php code. Taxonomy has to got 2 fields. I added new function to test_taxonomy.install, and it seems to work:
function taxonomy_update_8805() {

    $config_path = 'modules/feature/test_taxonomy/config/update/';
    $source = new FileStorage($config_path);

    \Drupal::entityManager()-&gt;getStorage('taxonomy_vocabulary')
        -&gt;create($source-&gt;read('taxonomy.vocabulary.regulation'))
        -&gt;save();
}

Added new vocabulary to taxonomy.
Content of file:
langcode: pl
status: true
dependencies:
  module:
    - test_remote_vocabulary
third_party_settings:
  test_remote_vocabulary:
    is_remote: 0
name: 'Test'
vid: regulation
description: 'Test desc'
hierarchy: 0
weight: 0
 

The problematic part is when i try to add fields to the vocabulary.
I created 2 files
field.storage.taxonomy_term.field_regulation_test.yml
langcode: pl
status: true
dependencies:
  module:
    - taxonomy
    - text
id: taxonomy_term.regulation.test
field_name: test_field
entity_type: taxonomy_term
type: text_long
settings: {  }
module: text
locked: false
cardinality: 1
translatable: true
indexes: {  }
persist_with_no_fields: false
custom_storage: false

field.field.taxonomy_term.field_regulation_test.yml
langcode: pl
status: true
dependencies:
  config:
    - field.storage.taxonomy_term.field_regulation_test
    - taxonomy.vocabulary.regulation
id: taxonomy_term.regulation.test
field_name: test_content
entity_type: taxonomy_term
bundle: regulation
label: TEST
description: 'Tekst test'
required: true
translatable: false
default_value: {  }
default_value_callback: ''
settings: {  }
field_type: text_long

But i am not sure how can i load them in update_xxx function.
EDIT:
I tried
    \Drupal::entityManager()-&gt;getStorage('taxonomy_term')
        -&gt;create($source-&gt;read('field.storage.taxonomy_term.field_regulation_abo'))
        -&gt;save();
        
    \Drupal::entityManager()-&gt;getStorage('taxonomy_term')
        -&gt;create($source-&gt;read('field.field.taxonomy_term.field_regulation_abo'))
        -&gt;save();

but i'm getting Missing bundle for entity type taxonomy_term while trying to update module
Yes, you can't create content before the relying config has been imported. That's a classic Drupal 8 paradox which has just recently been solved by a new hook: hook_deploy_NAME(&amp;$sandbox).
Update to the latest Drush and from now on run drush deploy as part of your deployment routine, which replaces the old drush updb &amp;&amp; drush cim routine. Then create a new file in your module: MYMODULE.deploy.php. In there implement MYMODULE_deploy_NAME(&amp;$sandbox) where NAME can be any unique name (or an incrementing number as well). And use this hook to create the terms, same as in the hook_update_N(&amp;$sandbox) in your question.
drush deploy will ensure that this hook will be picked up at the very last in the deployment routine, after the relying config has been created from configuration import.