Its not must that 3x have to be the one to be subtracted. You could take 8x as well.
But always subtract from the smaller one (in this case 3x) because its easier.
If you are subtracting 3x-3x and 8x-3x, the equation would be like
4 = 5x - 16
5x = 4+16
5x = 20
x = 4