Writing drupal hook_update_N() in Drupal 8, Drupal 9, Drupal 10. This also describes why hook update is needed, how it is formed.
This post explains how and when to use drupal hook presave