Yes, though I can't imagine why you would use a complicated numerical method when it is easy to solve for an exact solution.
What I would do is this: let u= y' so we get the first order equation $\displaystyle xu'- 2u= -\frac{2}{x^2}$. That is linear so we can separate it, first solving $\displaystyle xu'= 2u$ which in turn can be separated to $\displaystyle \frac{du}{u}= 2\frac{dx}{x}$. Integrating $\displaystyle ln(|u|)= 2ln|x|+ C$ which is equivalent to $\displaystyle u(x)= cx^2$.
To find a "particular solution", use "variation of parameters": seek a solution of the form $\displaystyle u(x)= v(x)x^2$. Then [tex]u'= v'x^2+ 2xv[tex] and the differential equation becomes $\displaystyle xu'- 2u= x^3v'+ 2x^2v- 2x^2v= x^3v'= -\frac{2}{x^2}$ so $\displaystyle v'= -\frac{2}{x^5}$.