No matter how many times you go diving, you may always have the fear of what would happen if your equipment malfunctioned or even if your mask flooded. To give you peace of mind, due to the pressure inside of the mask it is very difficult for water to get inside of them. Basically, the air will push out the water faster than the water will enter in even if the seal is broken. However, it is not foolproof and the potential is there that you could actually flood your mask.
There is no need to panic in this situation and you just need to keep a few things in mind. Number one, you should look up and press the purge button on your regulator as this will drain out the water from the mask. Two, go back to your normal position and take a breath and then continue to repeat this process until the water has been removed.