Restriction works by including only those individuals in the study who fall within a specified range or category of the confounding variable. For example, if age is a potential confounder, a study might restrict participants to a specific age group, such as 30-40 years, to eliminate age-related differences between groups.