A properly fitting mask should not leak, but snorkeling is fun and a big smile can cause a small leak. Sometimes hair stuck in the mask skirt can cause a leak too.
A purge valve allows you to eliminate water through the one-way purge valve without removing or tipping your mask. If your mask has a built-in purge just exhale normally through your nose. The water will drain out of the purge valve.
The purge needs to be at the lowest point in order to work properly.
Standard snorkels flood when you descend so you need to clear the water after you surface before taking a breath. Just blow out the water by exhaling sharply then breath normally.
Dry-top snorkels keep water out of the snorkel while you are underwater. If any water has entered in your snorkel it can be cleared with a sharp exhalation. Sometimes when you surface you may not have enough air in your lungs to blow out the water. No problem. Just take out the snorkel, turn your head, get a breath, and then clear it.