a little bit of liquid dish detergent on both sides
Clean the goggles with shaving cream.
use two glasses. the heat from your face will not transfer through to the other outer glass. if you have a "air pocket" = no fog
I think the other part of the equation besides a coating is to try to ventilate the area between you and the "glass" and get rid of the humidity or temperature buildup. Some goggles have vents along the edges covered with foam as a windbreak. This of course would not work for a swimming or scuba dive mask.
. Saliva works very well.
. Check skin-diving sites.
. Many anti-fog products sold for cars.
There are anti-fog sprays commercially available. But you can do it yourself; all you need is a thin coat of something with detergent, like shampoo. It works by breaking the ability of water to stick to itself and remain in light-scattering droplets. Without this cohesion, the water instead sticks to the glass, spreading out into a thin solid layer of water.Glycerin or an anti-static fabric softener might have the added advantage of moistening itself immidiately.