To keep my scuba face mask from fogging up I was taught to spit in it. You then wipe your saliva around and put on the mask. The very first time I was standing on the deck of a boat, waiting to jump 15 feet to the water and needed to spit in my mask, I found that nerves had dried me up! The best solution for defogging a mask I've found is 500 psi Mask Defogger.
When a mask is new, make sure to clean the inside surface of the glass with some toothpaste. It'll rub the chemicals the manufacturer put on the glass to make the machine processes less prone to breakage. If you don't those chemicals will cause the mask to fog a lot, regardless what you do, until use rinses them out.
Having done that, I rub a healthy amount of 500 psi inside my mask before my first dive, lightly rinse it out, and don the mask. One treatment tends to be good for several tanks of diving. Generally it will last all day and I may only need some more come night-dive time.
In the world of "just use some dish soap or shampoo," I'd say 500 psi reminds me most of Head and Shoulders. Those things work with varying degrees of success, as does spit, but why take a chance?
Nothing is worse than spending a few days getting to dive site and battling a fogging mask your first dive. Remember, you can flood your mask and clear it for temporary relief too!
500 psi Mask Defogger Great for Scuba Divers via Amazon