How do you rearrange an equation so that the X is alone ?

Example: (g=6x),
(Z=m-x)
Or (u=2x-2)
Please help !