How can I update the name of a taxonomy term using hook_update_N? I have taxonomy terms of color and I made a typo in one of the color name. It should be 'Crystal Black Pearl' instead of 'Crsytal Black Pearl'. How do I change it using hook_update_N ? Thank you in advance.
function honda_model_install() {
  $term = \Drupal\taxonomy\Entity\Term::create([
    'vid' =&gt; 'honda-color', 
    'name' =&gt; 'Crsytal Black Pearl',
  ]); 
  $term-&gt;save();
}
honda_model.install
/**
* Fix typo of term name.
*/
function honda_model_update_8101() {
  $terms = \Drupal::entityTypeManager()
    -&gt;getStorage('taxonomy_term')
    -&gt;loadByProperties([
        'name' =&gt; 'Crsytal Black Pearl',
        'vid' =&gt; 'honda-color'
      ]); // load using typo
  if (!empty($terms)) {
    $term = reset($terms);
    $term-&gt;setName('Crystal Black Pearl'); // make correction
    $term-&gt;save();
  }
}

Make sure you include the block comment, as that's what gets displayed to the user when they go to /update.php
Flush all caches so hook gets pickedup.
PS: once update.php runs it gets recorded in the DB that it ran and it will not run this again. So if you later on need todo another update, you need to add a new hook and increase the number, EX: honda_model_update_8102.