How to separate variables in DiffEq of $y'=x-y$ $$\frac{dy}{dx} = x-y$$
How do I separate so I can integrate both sides?
Thanks for getting me started.
I know the solution is $$ y = x-1+2e^{-x}$$

You can't separate. If you want to make it separable you can notice the equation is homogeneous and use the substitution $vx=Y$.
Otherwise, if you know how to solve linear differential equations, turn this into $y'+y=x$. The integrating factor is just $e^x$. So we have $\frac{d}{dx}(e^x y) = xe^x$.
Integrate with respect to $x$ and you get $(x-1)e^x + C = ye^x \Rightarrow  y=x-1+Ce^{-x}$
