In functions.php:

add_action('wp_enqueue_scripts', function() {
  // Deregister the stock library
  wp_deregister_script( 'jquery' );
  // Register the library again but using Google's CDN
  wp_register_script( 'jquery', 
                      false );
  // Register the script for your plugin like this:
  wp_register_script( 'my-custom-scripts', 
                      plugins_url( '/js/my-custom-script.js', __FILE__ ), 
                      ['jquery'] );
  // Register the script for your theme like this:
  wp_register_script( 'my-custom-scripts', 
                        ['jquery'] );
  // Then enqueue the scripts in either plugin or in the theme:
  wp_enqueue_script( 'my-custom-scripts' );

It outputs in the source code headers like so:

<script type='text/javascript' 
<script type='text/javascript' 


There is a compelling reason why going this route for plugins or themes meant for public release is a bad idea. It is because all the plugins and themes on your site will now have to use this specific version of jQuery. It is a bad idea to assume that other themes and plugins will work with this exact version without a hitch. Also, the CDN version of jQuery doesn't have the noConflict set, this means that other JS libraries will break.