Passing Variables between PHP and jQuery

How to pass variables from PHP to jQuery and javascript using the wp_localize_script WordPress function.