I shot some fireworks for my first time last year and got some nice results. Here's what I did.
Camera on a sturdy tripod is a must as well as a remote shutter release. You can find them very cheap on EBay.
A wide angle lens is probably best if you are a 1/4 mile or so away. An 18-55 is usually perfect but take a longer lens incase you're farther away.
You'll want to set the camera to (Bulb mode)which means the shutter will stay open for as long as you hold down on the shutter button.
Set ISO to 100
Set Aperture to either f8 for shorter exposures or f16 for longer ones. f11 worked pretty good for me.
As for the focus, you need to set it, then put the focus in Manual mode so it doesn't change while shooting. You can either manually set the focus to infinity, that sideways 8 at the end of the distance scale on the lens where the L points to or use auto focus on one of the fireworks displays, then switch the lens to MF. Either way be sure not to touch the zoom or focus ring once things are set.
There is no exact science on how long to leave the shutter open for but it's usually going to be from 2 to 20 seconds. It all depends on the particular display and how close together they are. You just have to feel things out but there is some luck involved too.
The first photo below was 13 seconds long and the second was only 4 seconds, so you just have to go with the flow and try different length exposures.