How do I redirect after saving the user account with $user->save()? How can I redirect users in a custom module after saving a user account with $user-&gt;save()? It always goes to the user profile after saving and I want to redirect to a custom page. 

function user_update_redirect(&amp;$form, $form_state) {
  $value1 = $form_state-&gt;getValue('panel');
  $value2 = $form_state-&gt;getValue('type_of_user');
  $storage = \Drupal::service('entity_type.manager')-&gt;getStorage('taxonomy_term');
  $user = \Drupal::currentUser();
  $user = user_load($user-&gt;id());
  $user-&gt;set('field_panel', $value1);
  $user-&gt;set('field_type_of_user', $value2);
  kint($user);
  $user-&gt;save();
}
I suppose you want to remain on your site when redirecting.
I don't recommend hardcoded URL's anywhere else but in route.yml files.
Call the right service and don't forget to use dependency injection in your services and don't use a trait or directly call it from the container.

  private function redirect(string $route) {
    $path = $this-&gt;container-&gt;get('url_generator')-&gt;getPathFromRoute($route);
    return new RedirectResponse($path);
  }