Attach a small piece of JS to an already enqueued script. Use 'after' to print it after the script, or 'before' to print it before.
function lotgrafix_inline_script() {
wp_enqueue_script( 'lotgrafix-main', get_template_directory_uri() . '/js/main.js', array(), '1.0.0', true );
wp_add_inline_script( 'lotgrafix-main', 'console.log("Loaded after main.js");', 'after' );
}
add_action( 'wp_enqueue_scripts', 'lotgrafix_inline_script' );