this may be obvious or repair 101, but for those who could use the info, I just repaired the rotted foam air shields on my otherwise fine goggles with some air conditioner filter foam and contact cement.
The most challenging part was making a paper template to cut the foam to. Lay a slightly oversize piece of paper onto the goggle frame, cut darts to get around curves, and trace with a felt-tip pen. Start cutting down until you match the opening in the frame.
A tailor's chalk wheel is a great way to mark the foam.
Good old weldwood contact cement used to the do the job, and it still does. Don't let it sit for 1/2 hour before joining parts. 5 minutes works just fine. Don't apply to the foam, just the goggle frame.
A toothpick was the easiest way to get the cement on the framing members that back the foam.
Once you have the foam in place on the glue, run your fingernail around the perimeter to "tuck" the edge of the foam into the goggle frame corner and the glue that you put there.
Use scotch tape lightly applied to the foam and extended out onto the goggle frame to let it dry overnight.
Keep the templates you made for when the foam rots again.