A confounding variable is a variable that affects both the independent and dependent variables, making it difficult to isolate the effects of the independent variable. It can be controlled for by measuring and controlling for any potential confounding variables that may be impacting the study.