Assume an example problem of 10110011 - 00101101. The first step is to take the 1's complement of the number we are subtracting (00101101). The 1's complement is the exact inverse of the number meaning every 0 becomes a 1 and every 1 becomes a 0. In our example 00101101 becomes 11010010.
Create the 2's complement by adding 1 to the 1's complement. In our example this is 11010010 + 1 = 11010011.
Add the 2's complement number to the number we were going to subtract from. In our example this is 10110011 + 11010011 = 110000110. Notice there is one more bit of carry over after this addition, this carry over is thrown away so our result is 10000110.
Assume an example of 10110011 - 101010, in which we have 2 fewer bits in the number we are subtracting than the number we are subtracting from. In this case, we need to add as many leading 0's to the number so that it has the same number of bits before we perform the same 2's complement steps as above.
Add two leading zero's to 101010 so that it becomes 00101010.
Compute the 1's complement of 00101010, which becomes 11010101.
Compute the 2's complement by adding: 11010101 + 1 = 11010110
Complete the subtraction by adding 10110011 + 11010110 = 110001001. Again, throw away the carry over in the 9th bit so that the result is 10001001.