The chi-square test is used to compare observed data to expected data. It determines if differences between the observed and expected numbers are due to chance or something more significant. The chi-square test has several key steps: stating the null and alternative hypotheses, choosing a significance level, finding the critical value, calculating the test statistic by summing the squared differences between observed and expected values divided by the expected value, and making a conclusion by comparing the test statistic to the critical value. The chi-square test has assumptions of adequate sample sizes and independence of data. It is useful for testing goodness of fit, independence of attributes, and homogeneity.