Think in terms of shovels.
If the father can dig, on average, f shovels per hour and it takes W shovels to dig the well, it would take the father, working alone, W/f hours to dig the well.
Similarly if the son can dig, on average, s shovels per hour, it would take him, working alone W/s hours to dig the well, (and notice in passing that this is the number to be calculated).
Now, the well can be dug if the father works for 6hrs and the son for 12 hrs, so
6f + 12s = W
and similarly
9f + 8s = W.
Multiply the first equation by 3 and the second by 2,
18f + 36s = 3W
18f + 16s + 2W,
and subtract,
20s = W,
so W/s = 20.