Write a=B-x (swap left and right sides) and add x to each side: a+x=B, now subtract a from each side: x=B-a.
Or, you could start with a=B-x and add x-a to each side: x=B-a in one step.
If you start with B-x=a, you can multiply both sides by -1 (which reverses all the signs):
-B+x=-a, then add B to each side: x=B-a.