How to enqueue a script AFTER the combined Autoptomize JS

I’m trying to enqueue a script after the combined Autoptomize JS but it never renders after, no matter how high a priority I set. I have seen this post but got lost trying figure out how to use the “return array”. Any chance you can elaborate a bit on the answer on how I use wp_register_script and wp_enqueue_script within or separate from that array?

Thanks so much 🙂

wp_register_script('custom', get_stylesheet_directory_uri(). '/js/script.js', false, false, true);
wp_enqueue_script('custom');
add_action( 'wp_enqueue_scripts', 'scripts', 99999999999 );

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer