To add or subtract expressions, expand them to make their denominators the same. Least common multiple of $xy$ and $y\left(x+y\right)$ is $xy\left(x+y\right)$. Multiply $\frac{x^{2}+y^{2}}{xy}$ times $\frac{x+y}{x+y}$. Multiply $\frac{x^{2}}{y\left(x+y\right)}$ times $\frac{x}{x}$.
Since $\frac{\left(x^{2}+y^{2}\right)\left(x+y\right)}{xy\left(x+y\right)}$ and $\frac{x^{2}x}{xy\left(x+y\right)}$ have the same denominator, subtract them by subtracting their numerators.
Since $\frac{x^{2}+xy+y^{2}}{x\left(x+y\right)}$ and $\frac{y^{2}}{x\left(x+y\right)}$ have the same denominator, subtract them by subtracting their numerators.