Before fitting your face mask, wash your glasses or sunglasses lenses with soapy water and shake off the excess moisture. Then, let your glasses air dry or gently dry the lenses with a clean microfiber cloth. Using this method, the lenses shouldn’t fog up once you put on the mask and glasses.
Make sure your mask actually fits. A mask that is properly fitted to your face and fastened snugly will force air out through the bottom or the side of the mask, rather than up over your glasses. The looser the mask, the foggier the glasses.
Some masks come with mouldable nose strips which help in minimising this problem. Alternatively, tuck a tissue under the nose strip of your mask to fill up any gaps, if it’s not fitting quite right. It might not be super comfortable, but it’s more comfortable than walking into walls.
Most opticians and pharmacies sell anti-fog lens coating and de-misting sprays.
Failing all else, use soap and water. Just wash your glasses, dry them appropriately (with a microfibre cloth, for example) and fogging will be minimised.