You can just form an equation to solve for them. Call the smaller number x, and the larger number must be x + 6. We know the sum of these two numbers is 56, hence:
x + (x + 6) = 56
2x + 6 = 56
2x = 50
x = 25
This means the smaller number is 25. The larger number is 25 + 6 = 31.
I hope this helps :)