A test statistic is a standardized value derived from sample data during a hypothesis test, used to determine whether to reject the null hypothesis. It quantifies the degree of agreement between the sample data and the null hypothesis, guiding the decision-making process in statistical inference.