Haven't done the fogs, but on the headlights it was the relay with a positive and ground to the battery, a connector to one of the factory headlight connectors with a separate ground for that, and then the two lines connecting to the HID ballasts. I bought my relay for $15.