These scripts will usually be presented to you on a page that describes the script and which presents you with a link that when selected will run the script immediately against the current web page. To store the script for later use you must right click on this link and select the option from the context menu to save it to your favorites or bookmarks. Depending on which browser you are using you may then get a warning message that the script is potentially unsafe. Assuming that you trust the web site where you found the script you need to tell your browser to go ahead and save the script anyway.
Once you have one or more of these scripts attached to your favorites or bookmarks menu, you can then run the script against any web page you want by simply selecting that option from the menu. Provided that the web page does not contain code that interferes with the operation of your script it will perform exactly the same regardless of which web page you run it against but any references within the script will refer to the currently displayed web page and not the page where you obtained the script.
Bookmarklet scripts can perform a variety of functions but one area where they are particularly useful is when they are designed to provide information about the current web page that assists you in fixing any errors in the functioning of your page