So we know that the sum of their ages is 95, and the difference is 21. We don't know either of their ages, but we can do that with a little algebra. 
Defining some variables:
x = teacher's age
y = principal's age
From there, we can turn those sentences from the problem into mathematical statements. 
x + y = 95
x - y = 21
Next, we want to isolate the system of equations to get only one variable. We can do this by adding the two equations together. 
In doing that, you'll get 2x = 116. 
Solving for x (divide both sides by two) will get you 58. 
Now you know your teacher's age (58). You can plug this back in to solve for your principal's age. 
58 + y = 95
Subtract both sides by 58 and you'll get 37 for the principal's age.
Teacher's Age: 58
Principal's Age: 37