The key component of this recipe is the wp_enqueue_script function, which allows developers to load their own JavaScript files or to ask WordPress to load one of the scripts that it comes packaged with. While the function requires many arguments when loading your own scripts, which we'll cover in a later recipe, it only needs a single argument to load built-in scripts. In this example, that argument is jquery. To get a full list of default scripts available with WordPress, check out the code reference page for the function (https://developer.wordpress.org/reference/functions/wp_enqueue_script/).
Once you know which script to load, the call to wp_enqueue_script should be made from one of three action hooks, depending on the target page(s) where the script should be loaded. These are wp_enqueue_scripts for front-facing pages, admin_enqueue_scripts for administration pages, and login_enqueue_scripts for the login page, with the first one fulfilling our requirement for this recipe.