Wiring help please

It "came out" of there so if you have not cut it, should go "back in."

The 2 vs 4 ballast:

Original, older design ECUs needed a 4 pin resistor. These are known as a "5 pin box" but you cannot always tell by looking, as some newer "4 pin" boxes have 5 physical pins, it's just that the 5th pin doesn't do anything.

So an older, 5 pin box MUST have a 4 pin resistor

A newer 4 pin ECU CAN use either a 2 or 4 pin resistor, it's simply that the second resistor doesn't do anything.