relay wiring diagram is on the relay... but they are universal,
basically think of it as two circuits, one is from pin 30 to pin 87.... this is power to the thing you want to power (lights in this case)
the other circuit is pin 85 to pin 86.... this is the switch on/off for power flow through the other circuit above... so you have power to a switch (like a toggle on the dash or your light switch) then to pin 85... this tells the relay to "switch" on when charged, that power to the relay needs an earth to flow - so you hook pin 86 to earth - a connection to the car body or battery
there are a few types of realy, the above is a basic 4 pole, the 5 pole relays have two types, one type switchs power from one thing to another i.e. low beam on one side and high beam on other (alternating power form 87 and 87a i think)
the other 5 pole type is just like a 4 pole but has two pins that power when relay is switched on (2 x 87), basically just providing two places to connect to (so you can power left/right headlight with one realy say)