So I haven't seen this on here anywhere yet. Relays are great resources in 12v wiring. Although they might seem complicated at first, they are very simple once you get acquainted with them. Some people, including myself, might shy away from them at first as they seem too complicated, but the purpose of this little DIY is to show you that they aren't.
First of all, what is a relay? There are many kinds, the variety most often used in car audio is the SPDT (single pole, dual throw) type. This means they have a single source (the pole) and two outputs (the throws) that are either open or closed based on whether or not the relay is energized or not.
The most common style is known as the Bosch style, pictured below. There are five terminals, all serving different, but different functions. The terminals are as follows (for the example, I will be assuming you are tapping off an accessory power wire)
30 - The terminal for the power source to be switched. This would usually be a power wire coming from your battery.
85 - The input for your switching source. You would normally tap an accessory or ignition wire and connect it here. This is what will trigger the relay into opening or closing pins 87 and 87a. This is where the accessory power wire that you tapped into would connect to.
86 - Ground. Relay coils do not have polarity, therefore pins 85 and 86 can be hooked up either way (either one could be power or ground). I use 86 for ground, for no particular reason.
87 - Normally open terminal. When the coil is not energized (key is out of the ignition, accessory wire isn't live), no current will flow through this terminal. When you turn the key on (accessory wire becomes live), the coil will energized and terminal 87 will become live. If you for example, wanted a power inverter to turn on when you turn the key, you would turn the key to acc and the coil would energize, turning the inverter on.
87a - Normally closed terminal. When the coil is not energized, this terminal will have power.
So, between 87 and 87a, only one can have power at a time. Think of the coil as being able to route the power between the two terminals.
EXAMPLE: Say I wanted to wire up some neon lights in my trunk so that they come on whenever my amps are turned on. I don't want to wire them right to the remote line, I want them to get power directly from a distro block mounted in my trunk.
I would tap the remote wire going to the amplifier and connect it to terminal 85 on the relay. Terminal 86 would go ground. I would run a wire from the distro block to terminal 30. Finally, the neon lights would be connected to terminal 86. Simple as that, the neon lights will turn on with the amplifiers.
I guess this was a bit longer than I wanted it to be, but hopefully it's simple enough for a beginner to understand, I've explained everything with as little writing as possible, but with enough for you to get a good idea how everything works.
If there's any other questions or comments, post em in the thread

.
And for further reference, a drawing of what the pinout on the bottom of a Bosch relay looks like.
