The ones have I used have 4 terminals labeled and oriented as follows:
87
..._
86
.|
...| 85
30
...|
30 = Unswitched power from battery
87 = Power going to lights
86 = Power coming from existing light switch
85 = Ground.
Currently power comes from the dash switch and flows to each light using separate wires however that power is now going to only be used to run terminal 86 on the relays to activate the electromagnet which gets its ground from terminal 85. You can cut the existing wire going from the headlight switch to the individual headlamp or find the existing inline connector to disconnect and re route to the relay. There should be 2 power feed to each headlamp with 1 for the low beam and the other for the high beam so 4 relays would be needed if you keep them separate.
A new fused power source will be connected to terminal 30 and the existing wire that you cut or disconnected going to the headlamp will be connected to terminal number 87.
Its only 12 volts DC off an automotive battery so you won't need lineman's gloves to prevent electrocution but may want to disconnect the battery to prevent accident short circuits while working on things especially if you wear metal jewelry since a metal chain, band or ring can get hot enough to burn you when powered up by a car battery just like the cigarette lighter. You can choose to do only one at a time so if you make a mistake you won't be overwhelmed with totally non-functional headlamps.
If any of this makes you feel terribly uneasy then get one of the fine kits out there. Doing it yourself does provide a level of satisfaction and a greater knowledge of how this works. Either way is good if your meticulous and pay attention to detail. Don't do it when your pressed for time, tired or feeling unwell.
Here is a simple video explanation of how an automotive relay works which covers the 5 terminal relay however what is presented about terminal 30, 85, 86 and 87 applies also to the 4 terminal relay by just ignoring terminal 87A:
https://www.youtube.com/watch?v=Tw9QkkT2ptU