Ventilation helps improve air quality because it helps remove or dilute pollutants inside your house by cycling fresh outdoor air through the home. Ventilation can easily be achieved by opening your windows and doors, or if you're cooling your home, running the air conditioner with the vent control open. Read the full guide for more on improving ventilation to improve indoor air quality.
The only time you don't want to encourage ventilation is when there are a lot of outdoor pollutants. This can include smoke from a nearby fire or wildfire or smog if you live in a polluted region. Just be mindful of when to open windows and doors and when to seal off your indoor air.