Custom User Field selected value as default for Drupal

With help from the awesome Ryan!

 'profession' => [
          '#type' => 'select',
          '#title' => $this->t('Professional Category'),
          '#required' => TRUE,
          '#empty_option' => $this->t('- Select -'),
          '#options' => $professions,
          '#default_value' => isset($user) ? $user->get('field_profession')->target_id : '',
        ],

 

Profession is the custom user field.

:)