Keep pets home It may be tempting to bring along your dog(s) so everyone can enjoy the fun, but the loud noises aren't usually fun for pets. Plus, there are many other hazards - fire, food (dietary indiscretion), getting lost in the confusion, etc. that make staying home in a comfortable safe environment a good choice.
Keep pets indoors if possible It is advisable to close the curtains and turn on the TV or radio to provide some distraction. Calming or classical music are better than some TV or radio noise choices. Therapeutic music such as Through A Dog's Ear often work better at keeping your dog calm and providing an audio distraction.
Provide a safe "escape" place Many times pets will seek out a small den-like place (such as a crate), if they are fearful or stressed. If you do not already have a crate, bed or similar place that your pet can call his "own," it is recommended to create that safe place and familiarize your pet with it before needed, as a means of reducing stress during fireworks and thunderstorms.
Use a leash or carrier If you must be outside with your pet, keep the pet on a leash or in carrier at all times.
Practice fire safety Keep pet away from matches, lighter fuel, open fires, and fireworks - especially ones that are lighted on the ground. Pets may try to sniff (or eat) fireworks, and pet hair can easily catch fire if too close to the fireworks.
Take pet for a walk first If possible, make sure that you pet has time to "use the restroom" before the fireworks start. Some pets are too frightened to void once the fireworks begin, and this may lead to an "accident" later on.
Make sure pet ID is current! Make sure that your pet has proper identification tags, with current information, in case s/he gets away. This will help the local authorities (who are quite busy this time of year handling frightened runaways).
Have a Happy and Safe 4th of July!