Let's take 6, 12 as our first example. We're trying to find out the difference between the two...take 12 minus 6 and you get a difference of 6 between them.
Now the first problem, 4, -17...put the larger one first and subtract the smaller one. 4 minus negative 17 is the same as 4 plus 17 which is 21.
23-8 is 15, of course.
-1-14 is -15, but the difference between something can't be negative, so it's just 15.
18-(-3) = 18+3 = 21.