How to load a script code only in posts?

In the active theme, functions.php file or in your plugin,

function load_scripts() {
    if ( is_singular( 'post' ) ) {
        // Load the Javascript
        wp_enqueue_script( string $handle, string $src="", array $deps = array(), string|bool|null $ver = false, bool $in_footer = false );
    }
}
add_action( 'wp_enqueue_scripts', 'load_scripts' );