The best way to eliminate the air quality problems is to remove the source and open your windows. The very first thing to do is not to smoke in the first place and removing the source of pollution is the best way to deal with the smoke.
If that’s not possible, you can at very least ease up the symptoms. Opening the windows is going to give you a cleaner air in the home, but you also need to handle the residual gases, odors, and particulates that are going to persist in the air after leaving the window open for a good amount of time.
There are plenty of air purifiers to choose from, but none of them is going to eliminate smoke completely on its own. Tobacco smoke is made up of gaseous pollutants and particulate matter and most of the models out there aren’t made to eliminate gaseous pollutants.
You may have your shot at it with the mechanical air filters (HEPA filters are the best in their category) and the electronic air cleaners (ionizers). Even though they’re not 100% efficient, they may still reduce levels of small airborne particles. However, the air purifiers aren’t going to be able to lower the damaging effects of cigarette smoke.
Stay away from the ozone generating air purifiers, as they may irritate the lungs. In addition, ozone isn’t very effective on removing cigarette smoke anyways.
Long story short, the best way to protect yourself as a non-smoker from secondhand smoke is to forbid smoking in your home in the first place.