Get values from unlimted field programmatically in node_presave hook
You can loop over a field object and access each item separately, that's often more convenient than going through getValue():

function example_node_presave(Drupal\Core\Entity\EntityInterface $node){

  if($node-&gt;bundle() == "class") {
     foreach ($node-&gt;get('field_class_division') as $item) {
       echo $item-&gt;target_id;
     }
   }
}


And to access a specific delta (that's what the index in a multi-value field is called in the Field API), you can access it like an array as well, but you need to make sure that the deltas exist:

echo $node-&gt;get('field_class_division')[1]-&gt;target_id


See https://wizzlern.nl/drupal/drupal-8-entity-cheat-sheet for a very useful cheat sheet on how to work with the Entity Field API.