There are several different options depeding on what you want to do.
Probably the best option, if you a novice, would be to simply copy and paste the code into the form you wish to call the function from.
If your feeling brave you could try putting into a module or class file and making it...