Clean the terminals up with WD-40 and elbow grease the way Rich suggested first. The Packard 59 terminals in the H4 headlamp plugs are very heavy duty. As long as they have not been badly overheated to the point that the plug is melted or turned into a green lump of corrosion by road salt, so you can't recognize them as terminals, they can be salvaged.
If you need to replace the terminals... Don't use Butt connectors. They're not a reliable long term repair.
If the terminals are shot you can buy replacements for $0.25 each or less. They are Delphi Packard 59 series Female lock tab terminals.
Extract the failed terminal from the headlight socket just as you would a Packard 56 terminal. Crimp the replacement directly onto the wires after clipping off the failed terminal and stripping off the right amount of insulation. Once they are properly crimped on slip them back into the connector shell.
This is the Packard 56. The 59 terminals are just a little bigger.
VIDEO
Use five cavity or two cavity "double wire" two operation crimp tools. Crimp the conductor(s) and then crimp the insulation retainer wings in different slots. Much more versatile than the single operation tool that crimps both at the same time since you can use them across multiple connector families.
The professional grade tools last longer and tend to hold thier value at around 75% of new if you take care of em.
@ $100 Ratcheting Delphi Five Cavity "W" Crimp tool 12085271 @ $100 Double wire Packard 59 two cavity "W" crimp tool 12040070 How to crimp connectors.
VIDEO