In fluid mechanics, a gas (like air) is considered a fluid and operates under the mathematical formulae developed in this field. I believe the very essence of viscosity is displayed in the deformation characteristics of a fluid with regard to shear stresses. For example, the shear stress for a Newtonian fluid with respect to a flat plate is given by Newton's formula:
$$ \tau = \mu\frac{\partial u}{\partial y}$$
Where $\mu$ is the dynamic viscosity and $\partial u/\partial y $ is the local shear velocity.
However, a lot of fluids do not follow this formula, and are called Non-Newtonian fluids. They follow equations that are mathematically similar, but with some variations.
Essentially when it comes down to solving physics problems in terms of engineering, you should know the degree of effects of certain phenomena. For example, in airplane wings, lift occurs due to the presence of viscosity; however, in terms of calculations, we tend to neglect freestream viscous effects at Mach numbers below 0.3 because Bernoulli's principle can then be applied, which seems to provide answers with enough accuracy.
However, when it comes to analyzing things like skin-friction drag across the wing, we must take into account the viscous effects because they play a huge role in the flow characteristics across the surface.
So, when it comes to problem-solving, I believe you should check the flow parameters and boundary conditions (Reynolds number $Re$, Mach number $M$, etc.) of the system/control volume to check if viscous effects will require consideration in the calculations. A little research into viscosity of different kinds of fluids and their mathematical development (such as the formula for the Newtonian fluid above) will come a long way as you develop the ability to decide what approximations suit which conditions.