Unfortunately the worst thing you can do if you are having problems with fogging in lamps is to keep the car in a garage. What happens is that as soon as your car leaves the nice warm garage, all that nice warm moist air (it will be moist as warm air will hold more moisture than cold) condenses against the suddenly cold lens.
The only effective way of removing moisture from a lamp, that doesn't clear when the lamp is on, is as was mentioned by
Dibby. Remove the backcap and dry the lamp out with a hairdryer, however allow the lamp to thoroughly cool before replacing the backcap.
Trying to make a headlamp/foglamp air/water tight is not a good idea. The lamps need to be able to breathe to allow for the pressure differences due to heat. This is usually accomplished with a breather cap. Some of these are as simple as a little rubber tube facing downwards, some are like little tophat features with some sponge inside, and nowadays we are starting to use Goretex patches.
One thing to check if you are getting water into any of your lamps is that the backcap is seated correctly and that the o-ring is in good condition, and that and breather caps have not fallen off.
Hope this helps
