In general, whenever you have an expression of the form
$$\dfrac{P(x)}{(x+a)^n}$$ where $P(x)$ is of degree less than $n$ and you want to write it into partial fraction, then you need to proceed as follows.
$$\dfrac{P(x)}{(x + a)^n} = \dfrac{A_1}{x+a} + \dfrac{A_2}{(x+a)^2} + \dfrac{A_3}{(x+a)^3} + \cdots + \dfrac{A_{n-1}}{(x+a)^{n-1}} + \dfrac{A_n}{(x+a)^n} \tag{$\star$}$$
and then find the coefficients $A_1, A_2,\ldots, A_n$. Note that from $(\star)$, we have
$$P(x) = A_1(x+a)^{n-1} + A_2 (x+a)^{n-2} + A_3(x+a)^{n-3} + \cdots + A_n$$
From this, we have $A_n = P(-a)$ and in general, $$A_k = \left.\dfrac{d^{n-k} P(x)}{dx} \right \vert_{x=-a}$$
In your case, though it is relatively simple since
$$\dfrac{x}{(1+x)^2} = \dfrac{1+x-1}{(1+x)^2} = \dfrac1{(1+x)} - \dfrac1{(1+x)^2}$$