How do I redirect users to an external URL?
Define a controller and redirect to external URL.

Use TrustedRedirectResponse class in case you know that you want to redirect to an external URL. Example below:

use Drupal\Core\Controller\ControllerBase; 
use Drupal\Core\Routing\TrustedRedirectResponse; 
class ExampleController extends ControllerBase {

  public function example() {
    return new TrustedRedirectResponse('https://google.com');  
  }
}