Happy Independence Day! Taking photos of fireworks is a lot like shooting lightning. Both require a long exposure, change quickly, and are very bright. They both can also make EXTREMELY BORING images if not handled properly. There are millions of images of fireworks floating around online, what are you going to do to make yours different?
A good starting point is choosing your location, and scouting it out properly. You want to make sure you have an interesting foreground. It might be people taking in the show, or even a cool cityscape to really draw the viewer into the image and make them interested in your image.
So you have your spot picked out, what do you need to actually take photos of fireworks? You're going to want to have a camera that is capable of long exposures of at least a couple seconds, you will also need a tripod, and a remote cable release (or some type of trigger). This time of year it is also a good idea to bring along some insect repellent and water, as it is usually still pretty warm when fireworks displays begin.
A fireworks show involves a lot of fireworks, so there is some time to experiment. The great thing about digital cameras is you can instantly preview your results, be sure your fireworks and/or scene aren't over or under exposed. Since fireworks produce basically monochromatic light (from chemicals), their colors will be distinct at a variety of apertures and ISO settings. A long exposure is required to let a few fireworks trace out their patterns. Different aperture, shutter speed, and ISO settings will affect the brightness of the scene. Other bright objects can often be distracting, but subdued rather than pitch black surroundings can really add interest to your shot. The aperture settings aren't very important for depth of field with far away fireworks, since they'll be essentially at infinity, and any foreground should be dim and indistinct in any event – it mainly matters for overall exposure, and a relatively wide aperture and low ISO will give less "noise" than a small aperture and high ISO.)
Before the show begins, do some experimentation with the scene to see what settings might be best for your location. Ambient light will make a world of difference in the overall settings for your photos. Once you have decided what you would like to use, double check your camera's settings just before the show, to be sure they are correct.
If your lens has IS (Canon) or VR (Nikon), be sure to turn it OFF before shooting. If you are shooting with an SLR or DSLR camera, chances are your lens has the IS (image stabilization) or VR (vibration reduction) feature built in. If you do have IS or VR (which is the same thing, just named differently by Canon and Nikon to confuse you a little more). Chances are, you probably leave this setting on for most of your shooting, and you should. IS/VR is meant to sense the vibration (the shaking of your hands, mostly) and compensate for it. When there is no movement, the image stabilization creates it, and will add a slight blur to your long exposure shots. Turn it off in order to get sharper images. (This tip goes not only for shooting fireworks, but is valid any time you shoot off a tripod.)
You have a plethora of options when it comes to what settings you should use for your fireworks photos. I don't recommend using very low apertures or very high ISO's, because that will often lead to the fireworks blowing out the shot. For the images used in this article my settings were f/13.0 for 6 seconds at ISO 320. This resulted in 85 images with fireworks in them, and I usually got at least two discharges in each shot.
Happy 4th of July, y'all.