How To Add The Help Scout javascript LiveChat from the WordPress menu

Use add_action to add a function to the wp_footer hook, and then inside the function you can check if you are on a specific page before outputting the script.

eg. the Help Scout scripts on the /contact-us/ page:

add_action('wp_footer', 'maybe_add_javascript');
function maybe_add_javascript() {
    if (!is_page('contact-us')) {return;}
    ?>
    <script type="text/javascript">!function(e,t,n){function a(){var e=t.getElementsByTagName("script")[0],n=t.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://beacon-v2.helpscout.net",e.parentNode.insertBefore(n,e)}if(e.Beacon=n=function(t,n,a){e.Beacon.readyQueue.push({method:t,options:n,data:a})},n.readyQueue=[],"complete"===t.readyState)return a();e.attachEvent?e.attachEvent("onload",a):e.addEventListener("load",a,!1)}(window,document,window.Beacon||function(){});</script>
    <script type="text/javascript">window.Beacon('init', '602b66a1-948e-493f-b0dd-c2828b2eb860')</script>
    <?php
}