The viscosity of a substance is affected by several factors, including temperature, pressure, and the presence of any solutes or impurities. As temperature increases, viscosity generally decreases. Pressure has the opposite effect, increasing viscosity. The presence of solutes or impurities can also increase viscosity by disrupting the fluid's molecular structure.