Window air conditioners (AC) are used to cool specific indoor spaces and some may help in reducing airborne viruses if they have an outdoor air intake and/or a MERV-13 or better filter. Note that AC units that have outdoor air intakes are not common. If your window air conditioner has an outdoor air intake, and outdoor air is clean, then open the intake to help increase ventilation with outdoor air, which helps to reduce any airborne virus.
Additionally, in some units the air may pass through filters as it moves through the air conditioner. To reduce airborne viruses, such filters need to have a MERV-13 or greater rating (or MERV-13 or greater equivalent filter). Check your AC manual for more information on filters for your specific unit.
However, by itself, a window air conditioner with an outdoor air intake and/or a MERV-13 or better filter is not enough to protect people from COVID-19. When used along with other best practices recommended by the Centers for Disease Control and Prevention, operating a window air conditioner can be part of a plan to protect yourself and your family.