Start by "naming" the things you want to find:
let a be the number of sweets Andy had and let m be the number of sweets marc had. They had 105 sweets altogether so a+ m= 105.
Now "interpret" each statement as an algebraic quantity.
"Andy ate 4/5 of his sweets". So he ate 4/5 of a, 4a/5 and had a- 4a/5= 5a/5- 4a/5= a/5 left.
"Marc ate 3/5 of his sweets". So he at 3/5 of m, 3m/5 and had m- 3m/5= 5m/5- 3m/5= 2m/5 left.
"In the end, the number of sweets Marc had left was 4/5 the number of sweets Andy had left."
This where we get the equation. Marc had 2m/5 sweets left and that was (was equal to) 4/5 of the number of sweets Andy had left. Andy had a/5 sweets left and 4/5 of that is (4/5)(a/5)= 4a/25.
2m/5= 4a/25. The first thing I would do is divide both sides by 2: m/5= 2a/25. Then get rid of the fractions by multiplying both sides by 5m= 2a.
So we have a+ m= 105 and 5m= 2a. From a+ m= 105, we see that a= 105- m. So 5m= 2(105- m)= 210- 2m. Surely you can finish.