Use this function ItemList::removeItem
if ($entity->hasField('field_items')) {
$items = $entity->get('field_items');
for ($i = 0; $i < $items->count(); $i++) {
if ($items->get($i)->target_id == $target_id) {
$items->removeItem($i);
// Caution: decrement the counter as removeItem() also does a rekey().
$i--;
}
}
// Don't forget to save the entity.
$entity->save();
}
Source: https://www.drupal.org/project/drupal/issues/2904621#comment-12283951