Why do glasses fog up in the first place?

Glasses will fog due to temperature changes and humidity.

If your glasses are cooler than the humid air that is hitting them, fogging will result.

Keep glasses from fogging while wearing a mask

Put tape on a mask to stop glasses from fogging

Wear a mask and keep glasses from fogging