To add a javascript file, do you simple put the script into the JS file and then call it from the location?

If this wrong can you please tell me how to do

Thanks