To take spectacular shots of fireworks, it is recommended to use a DSLR camera with remote control for long exposures, a stable tripod and a good lens, preferably with a wide-angle zoom that will prevent you from having to change lens in the middle of the event.
Many will also visit the site in advance to determine the best location from where to shoot, taking into account landmarks and nature in the background and even the direction of the wind.
For best results with an SLR camera, and many hybrid ones, you should choose manual exposure, set manual focus to infinity and aperture at f/8 or f/11 and shoot in Bulb mode in order to fully control the duration of the exposure.
When near water, you'll want to pick a place from where you can capture the reflection as well as the fireworks themselves. A dark sky always makes for a nice background with fireworks, but it may be interesting to include illuminated landmarks, buildings or simply nature elements.
If, on the other hand, your goal is to have a nice family outing and bring back neat memories, most compact cameras will do the trick. Equipped with wide-angle zoom lens, scene modes including Fireworks and vibration reduction mechanisms, today's compact cameras are capable of great pictures at the press of a button. You just frame and click at the right moment. Just be sure to include some smiles from the kids enjoying the show.