You simply need to subtract x from both sides:
[tex]x+y=4 \iff x+y-x=4-x \iff y=4-x[/tex]
In fact solving an equation for a variable means to isolate that variable on one side of the equation, and moving all remaining terms on the other side.
In this case, we solved the equation for y, because we wrote it as [tex]y=\ldots[/tex]