The differential equation $\frac{dy}{dx} = \frac{y}{x} - \frac{1}{y}\;$ I am learning differential equations and can do the basic examples. However, how can you solve the differential equation
$$\frac{dy}{dx} = \frac{y}{x} - \frac{1}{y}\;?$$

You already have nice solutions with substitutions. If one cannot come up with the right substitution, maybe this is a solution that works better:
Multiplying the differential equation with $y$ gives
$$
yy'=\frac{y^2}{x}-1,
$$
or
$$
\frac{1}{2}\bigl(y^2\bigr)'=\frac{y^2}{x}-1.
$$
This is a linear and first order differential equation for $y^2$, we write it as
$$
\bigl(y^2\bigr)'-\frac{2}{x}y^2=-2
$$
The integrating factor is $1/x^2$, so
$$
\Bigl(\frac{1}{x^2}y^2\Bigr)'=-\frac{2}{x^2}.
$$
Integrating,
$$
\frac{1}{x^2}y^2=\frac{2}{x}+C,
$$
where $C$ is an arbitrary constant. We can write this as
$$
y^2=2x+Cx^2\quad \text{or}\quad y=\pm\sqrt{2x+Cx^2}.
$$
