A t test is appropriate when you need to compare the means of two groups and the data meets the following assumptions:
The data is continuous (e.g., weight, blood pressure). The data is approximately normally distributed. The variances of the populations are equal (for an independent t test).