Dish soap can be used to prevent a foggy mirror, as well as condensation on windows. Shaving cream: If you have shaving cream on hand, you can use it just like toothpaste to prevent a steamy mirror.