A t-test is a statistical hypothesis test. People use it when they want to decide if two groups are the same or different.
For example, pretend there are two groups of people. One group exercises a lot and the other doesn't. Do the people who exercise tend to live longer than those who don't? A t-test can help answer this question.