The most common way of getting a viral infection is through inhalation. When an infected person sneezes or coughs near you, they release viral droplets that become airborne. These droplets can make their way into your system and cause an infection.