If you are using a point-and-shoot camera which doesn't allow you to adjust the camera settings manually, put your confidence in the scene modes available. Often there will be a fireworks mode that you can use and if not, try a night landscape mode. Even with a non-manual camera, the general tips presented in this article are still applicable.
When using a DSLR, or another camera which has manual controls, I highly urge you to flip that camera into the dreaded M mode. This gives you full control of how your image is going to come out.
First, choose a low to mid ISO setting, such as 200, to begin with. I would also start off with a mid-range for the aperture, such as F/8, in order to optimize depth of field and hit your lens' sweet spot. Both of these settings can be easily adjusted to get the proper exposure as necessary later.
The critical setting when figuring out how to photograph fireworks displays is the shutter speed. Like much night photography, you are going to have to use a slightly longer shutter speed. There are two approaches that you can take. First, you can set the shutter speed to 2 or 3 seconds and adjust it as necessary. This gives you control over the shutter but lacks the versatility to change the shutter speed quickly from one shot to the next. My preferred method is to put the camera on BULB mode (while using a shutter release) and hold down the shutter as long as necessary. This allows you to time firework bursts, adjust exposure time easily yet it lacks a consistent background exposure.
The final camera setting to verify is the focus. When learning how to photograph fireworks displays you will learn quickly that autofocus is your enemy. Like many other low light situations, your autofocus may have to search (and often fail) trying to find a point to focus on. This could be detrimental in capturing fireworks as it seems like they are over almost before they start. Switch your camera to manual focus before you start and you can easily avoid this problem.