Arrange to have your dog in a place where there won't be loud fireworks displays -- a friend's or relative's home or a doggie day care with which your dog is familiar. If it's an unfamiliar place for your dog, take him over there a few times in the days before the holiday so that it won't be a surprise when you take him there on the Fourth.
If you cannot take your dog to a place away from fireworks, then have a travel kennel at home for her to feel safe in. if you're not going to be home, have a friend or sitter there to keep your dog company and take her out to relieve herself every four hours.
The best way to prepare your dog for fireworks is to make sure he's comfortable with the sound in advance. While this is a simple process, it can take time -- possibly three or four months of playing the recorded sound of fireworks for your dog at an increasingly louder volume before he eats, before a walk, and before affection and play.
This will condition him by association to hear the sound and interpret it as something good. While you can try this method over only a week or two, in such a short time span it should only be used in conjunction with one or more of the other tips. In any case, play the firework sounds.
If you do find it necessary to use medication or a thundershirt to calm your dog during the fireworks, remember that you must introduce any such tool at the right time, conditioning your dog to understand that the medication or thundershirt is there to bring them to a calm state.
This means that you must bring your dog to that calm state first, then introduce the tool -- before the fireworks and the anxiety begin. If she is already at an anxiety level of 8 or 9, then her mental state will overrule the medication. If she is already breathing heavily, then the thundershirt, which is designed to slow her breathing, won't work. A tool is an intellectual thing we use with a dog's instincts. The challenge is knowing how and when to connect the two.
If you are going to be with your dog during the fireworks, sending the calming message that they are nothing to worry about will also help him to relax. Remember, though, while humans communicate with words, dogs communicate with energy, and will look to their pack leader for clues on how they should behave. If you're not making a big deal or showing excitement about the fireworks, then he will learn to be less concerned as well.
In all cases above, expend your dog's excess energy first, before the fireworks start, by taking her on a very long walk to tire her out and put her in a calm state.
Most importantly, don't think of this in terms of your dog as your child who is missing out on a great, fun time. That's human guilt. Your dog won't know what she's missing. You're being a good pack leader by not exposing her to a situation that will trigger her flight instinct in a negative way. When the booms and bangs of Independence Day are over, your dog will be grateful to you for having made it a less stressful experience!