Get taxonomy terms added to nodes
Another example:
As with all referenced entities you can load them quickly using the referencedEntities() method.

Also, if you are not using the Devel module and Devel Kint submodule, you should check it out. You can then use ksm() to explore variables and see available methods.

function hook_preprocess_node(&amp;$variables) {

  //make sure you have Devel module installed, then you can use ksm() to explore variables
  //ksm($variables['node']);

  if ($variables['node']-&gt;hasField('field_permit_city')) {
    //this will give you the referenced terms on the node as objects
    $term_objects = $variables['node']-&gt;get('field_permit_city')-&gt;referencedEntities();
    $term_labels = [];
    foreach ($term_objects as $term_object) {
      print $term_object-&gt;id(); //the id of the term
      print $term_object-&gt;label(); //the term title
      $term_labels[] = $term_object-&gt;label(); //build an array of term labels
    }
    //send an array of term titles over to the node twig template
    $variables['my_custom_template_variable'] = $term_labels;
  }
}


Then in your node.html.twig template you can iterate through the labels and do the stuff.

{% for term in my_custom_template_variable %}
    &lt;p&gt;{{ term }}&lt;/p&gt;
{% endfor %}