This article is from the Car Audio FAQ, by Ian D. Bjorhovde (email@example.com) with numerous contributions by others.
If you conclude that your best course of action is to install a
capacitor, it should be installed in parallel with the amplifier and,
generally speaking, should be wired with approximately the same gauge
wire used for a single amplifier (usually 8 ga. is sufficient even for
rather large capacitors).
Before permanently installing it, it must be charged. Failure to do so
could lead to blown fuses and lots of sparks! Some capacitors come
with charging resistors. If yours does not, you can simply buy an
automotive bulb and wire it in series with the capacitor's + lead while
the capacitor is grounded. The bulb will continue to dim until the
capacitor is fully charged. Once the capacitor is charged, it should
be treated as you would a car battery; caution must be used to be sure
not to short the terminals.
The final step is to permanently install it into the car. There's been
much debate about where to install the capacitor. It's been argued
that the placement is important because it requires shorter wire
lengths. While this is true, there has never been any evidence
supporting the notion that it should be installed as close
(electrically) to the amplifier as possible. In fact, electrical
theory demonstrates that it's more effective at quenching the dimming
effects by installing it as close to the device exhibiting the symptom
(ie. the headlights) rather than the device that's drawing the bulk of
the current (ie. the amplifiers). However, the benefit to doing so is
negligible. Therefore, hooking it directly to the battery, the
amplifier terminals, or the distribution block are equally valid
solutions as long as the mounting location is safe, the wire lengths
are reasonably short, and there's an adequate ground present.