you can only add/subtract fractions together only when they share the same denominator
since, 7 is nto equal to 8, that means you need "change" the fraction so that they will share the same denominator
you want to find the LCM(least common multiple) between 7 and 8 which will give you the smallest denominator that both fraction can share.
multiples of 7 are
7,14,21,28,35,42,49,56,...
multiples of 8 are
8,16,24,32,40,48,56,...
you will see that the LCM is 56, so you need to convert both fractions so that they will both have a denominator of 56
looking at 5/7, what operation/value (multiplication/number) can you multiply to 7 in order to get 56?
7*8 = 56, so in order to change the denominator of 5/7, you need to multiply the top and bottom by 8/8

now, why you can do this, because 8/8 is equal to 1, and multiplying any number by 1 will give you the same number
now doing the same thing for 5/8

so now, the problem is

just subtract the numerators