Look at your example. You were trying to find out 8321-4031 but you turned 8321 (8 thousands +3 hundreds +2 tens +1 ones) into (8 thousands + 2 hundreds + 12 tens + 1 ones).
Now, can you try and extend the same idea to break up 8000 in such a way as to solve the subtraction problem? Arildno has the answer, and if you think about what he said, you should be able to apply that idea to the way kids do it.
The way I learned it years ago:
You move to the left until you get to the first nonzero number from which you can borrow. Cross that number out, subtract 1 from it, and write that number above it (cross out 8 and write 7 above it in your problem). Cross out all the zeros and write 9 above them except for the rightmost 0; that zero gets a 1 before it so it becomes a 10. Then you can subtract each column of numbers.