* Use a tripod and a remote shutter release, if you can.
* Carefully frame the shot so that the horizon is straight and you don't get a bunch of heads in the picture.
* Set aperture between f/8 and f/16 and use ISO 100.
* Keep the shutter open for a couple of seconds, starting before the explosion. (Manual mode is your friend.)
* Turn off the flash.
* Experiment and have fun!
Source: For the 4th: How to Photograph Fireworks