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', 
                      'http://ajax.googleapis.com/ajax/libs/jquery/1.9/jquery.min.js',
                      [], 
                      null, 
                      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', 
                        get_template_directory_uri().'/js/my-custom-script.js', 
                        ['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' 
        src='http://ajax.googleapis.com/ajax/libs/jquery/1.9/jquery.min.js'></script>
<script type='text/javascript' 
        src='http://compendium.xyz/wp-content/plugins/my-plugin/js/my-custom-script.js?ver=1.1'></script>

Caveat

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.