How can I perform an operation programatically when the value of a user field is changed?
The Content translation module has code you could use, right in its hook_entity_presave() implementation (i.e. content_translation_entity_presave()).

if (!isset($entity-&gt;original)) {
  $entity-&gt;original = entity_load_unchanged($entity-&gt;entityType(), $entity-&gt;id());
}


In $entity-&gt;original you then find all the values that entity object had before being changed, as the documentation for entity_load_unchanged() says:


  Loads the unchanged, i.e. not modified, entity from the database.
  
  Unlike entity_load() this function ensures the entity is directly loaded from the database, thus bypassing any static cache. In particular, this function is useful to determine changes by comparing the entity being saved to the stored entity.


If you want to write code that will need less changes when passing to Drupal 9, you can use the following one, which replaces the call to entity_load_unchanged() (marked deprecated) with that function's code.

if (!isset($entity-&gt;original)) {
  $entity-&gt;original = \Drupal::entityManager()-&gt;getStorage($entity-&gt;entityType())-&gt;loadUnchanged($entity-&gt;id());
}


Also image_entity_presave() uses $entity-&gt;original, but it doesn't load it if it has not been set.

$original_uuid = isset($entity-&gt;original) ? $entity-&gt;original-&gt;getSetting('default_image')['uuid'] : NULL;


Probably, you could simplify the code.

if (!isset($entity-&gt;original)) {
  // Get the old value of the field.
}


Looking at the method calling hook_entity_presave(), EntityStorageBase::doPreSave(), the latter seems a more correct code.

  $id = $entity-&gt;id();

  // Track the original ID.
  if ($entity-&gt;getOriginalId() !== NULL) {
    $id = $entity-&gt;getOriginalId();
  }

  // Track if this entity exists already.
  $id_exists = $this-&gt;has($id, $entity);

  // Omissis

  // Load the original entity, if any.
  if ($id_exists &amp;&amp; !isset($entity-&gt;original)) {
    $entity-&gt;original = $this-&gt;loadUnchanged($id);
  }

  // Allow code to run before saving.
  $entity-&gt;preSave($this);
  $this-&gt;invokeHook('presave', $entity);


EntityStorageBase::doPreSave() already sets $entity-&gt;original for entities that aren't new; the code used from content_translation_entity_presave() seems excessive.