What is the recommend directory in which I can upload a new library?

You can create a child theme folder named yourTheme-child in your theme’s folder, and then upload your JavaScript files in that folder. (notice that yourTheme is the name of your theme’s folder)

You might also want to create a folder named js inside that.

Take a look at : Child Themes

Child themes will not be deleted after updating your template/wordpress.

Then you can simply include your Js file in the header/footer this way:

<script type="text/javascript" src="https://wordpress.stackexchange.com/questions/255221/Full URL Goes Here"></script>

or even better, enqueue your script it in the functions.php file using the below code:

function my_custom_script() {
    wp_enqueue_script( 'my-custom-js', "https://wordpress.stackexchange.com/questions/255221/Full URL Goes Here", false );
}
add_action( 'wp_enqueue_scripts', 'my_custom_script' );