Let b>a
We are told that b=a+6 and that a+b=30
Using the value of b=a+6 in a+b=30 gives you:
a+(a+6)=30 combining like terms on left side
2a+6=30 subtract 6 from both sides
2a=24 divide both sides by 2
a=12, and since b=a+6
b=18
So the two numbers are 12 and 18.