Place the number to be subtracted below the first number so that the thousands', hundreds', tens' and ones'
places are lined up. Draw a line under the bottom number.

6583
4729

Subtract the bottom ones' place digit from the top ones' place digit (3 - 9).
We do not know how to do this so we need to rearrange the number to make the
top value larger. Borrow one ten from the top tens' place digit and make the
3 into 13. The top tens' place value becomes a 7 after borrowing one ten from it.
Now subtract 9 from 13 to get the answer of 4. The 4 is placed below the line in
the ones' place column.

7
6583
4729
4

Subtract the digits in the tens' place column (7 - 2 = 5) and place the answer
below the line in the tens' place column.

7
6583
4729
54

Subtract the numbers in the hundreds' place column (5 - 7 = ?). Once again,
rearrange and borrow one from the thousands' place to make the top value larger
than the bottom value. When this is done subtract (15 - 7 = 8) and place the
8 below the line in the hundreds' place column.

5 7
6583
4729
854

Subtract the digits in the thousands' place column (5 - 4 = 1) and place the
answer below the line in the thousands' place column