Masks primarily function by blocking respiratory droplets that may contain infectious agents such as viruses and bacteria. When an infected person talks, coughs, or sneezes, they release droplets into the air. Masks act as a barrier, reducing the transmission of these droplets.