From the condition, you have these two equations
T = M + 6 (1) ("Trevor is 6 years older than Miranda.")
(T+8) + (M+8) = 60 (2) ("In 8 years the sum of their ages will be 60.")
Substitute the expression (1) for T into eq(2). You will get
((M+6) + 8) + (M+8) = 60
2M + 6 + 8 + 8 = 60
2M + 22 = 60 ====> 2M = 60 - 22 = 38 ====> M = = 19.
Then T = M + 6 = 19+6 = 25.
Answer. M = 19, T = 25.