To call a function from your HTML file, include a script tag that references your JavaScript file, like above. Then, in your JavaScript file, define the function and attach it to the global object (e.g., window):
// your-script.js
function myFunction() {
// function implementation
}
window.myFunction = myFunction;
In your HTML file, you can then call the function using its global name:
<button onclick="myFunction()">Call myFunction</button>