Find two numbers whose sum is 20 and LCM is 24 With some guess work I found the answers to be 8 and 12.
But is there any general formula for this?
Note that the question is asked to my nephew who is at 4th grade.

You want two factors of $24$ that add up to $20$.   That means one factor must be less than or equal to $10$ (i.e. $20/2$), and the other must be between $10 $ and $20$ (inclusive) since it is equal to the first subtracted from $20$.
The only factor of $24$ between $10$ and $20$ inclusive is $12$.    $20-12 = 8$.   $8$ is a factor.
So the solution is $8$ and $12$.
