Given a connected topological space $X$ with $\pi_n(X) = G$ and $\pi_i(X) = 0$ for $i = 1, \dots, n - 1$, you can build a $K(G, n)$ by attaching cells of dimension at least $n + 2$ to kill the higher homotopy groups.
Suppose you start with $X = \mathbb{RP}^2$ which has $\pi_1(X) \cong \mathbb{Z}_2$. Then $\pi_2(\mathbb{RP}^2) = \mathbb{Z}$ and is generated by the covering map $S^2 \to \mathbb{RP}^2$. Attaching a three-cell to $\mathbb{RP}^2$ with attaching map given by the covering map $S^2 \to \mathbb{RP}^2$ gives a space $X'$ with $\pi_1(X') = \mathbb{Z}_2$ and $\pi_2(X') = 0$; in fact, $X'$ is homotopy equivalent to $\mathbb{RP}^3$. Now note that $\pi_3(\mathbb{RP}^3) \cong \mathbb{Z}$ generated by the covering map $S^3 \to \mathbb{RP}^3$. Attaching a four-cell to $\mathbb{RP}^3$ with attaching map given by the covering map $S^3 \to \mathbb{RP}^3$ gives a space $X''$ with $\pi_1(X'') = \mathbb{Z}_2$ and $\pi_2(X'') = \pi_3(X'') = 0$; in fact, $X''$ is homotopy equivalent to $\mathbb{RP}^4$. Repeating this procedure ad infinitum, we see that $\mathbb{RP}^{\infty}$ is a $K(\mathbb{Z}_2, 1)$.
Suppose now you start with $X = S^2$ which has $\pi_1(X) = 0$ and $\pi_2(X) \cong \mathbb{Z}$. Then $\pi_3(S^2) \cong \mathbb{Z}$ and is generated by the Hopf map $S^3 \to S^2$. Attaching a four-cell to $S^2$ with attaching map given by the Hopf map $S^3 \to S^2$ gives a space $X'$ with $\pi_1(X') = 0$, $\pi_2(X') \cong \mathbb{Z}$, and $\pi_3(X') = 0$; in fact, $X'$ is homotopy equivalent to $\mathbb{CP}^2$. Now note that $\pi_4(\mathbb{CP}^2) = 0$ so we don't need to glue on any five-cells, but $\pi_5(\mathbb{CP}^2) \cong \mathbb{Z}$ generated by the quotient map $S^5 \to \mathbb{CP}^2$. Attaching a six-cell to $\mathbb{CP}^2$ with attaching map given by the quotient map $S^5 \to \mathbb{CP}^2$ gives a space $X''$ with $\pi_1(X'') = 0$, $\pi_2(X'') \cong \mathbb{Z}$, and $\pi_3(X'') = \pi_4(X'') = \pi_5(X'') = 0$; in fact, $X''$ is homotopy equivalent to $\mathbb{CP}^3$. Repeating this procedure ad infinitum, we see that $\mathbb{CP}^{\infty}$ is a $K(\mathbb{Z}, 2)$.
The case for cyclic groups is similar to the first example. Note that $\mathbb{RP}^2$ can be viewed as a circle with a two-cell attached via the double covering map $S^1 \to S^1$. Likewise, a circle with a two-cell attached via the $k$-sheeted covering map $S^1 \to S^1$ is a topological space $X$ with $\pi_1(X) \cong \mathbb{Z}_k$. The above procedure then shows that the infinite lens space $S^{\infty}/\mathbb{Z}_k$ is a $K(\mathbb{Z}_k, 1)$. In order to obtain a $K(\mathbb{Z}_k, n)$, one can form the space $X$ obtained by attaching an $(n + 1)$-cell to $S^n$ with attaching map given by a degree $k$ map $S^n \to S^n$; equivalently, $X$ is the previous space suspended $n - 1$ times. This space has $\pi_n(X) \cong \mathbb{Z}_k$ and $\pi_i(X) = 0$ for $i = 1, \dots, n - 1$. I don't know of an alternate description of the space you obtain from the above procedure applied to $X$, other than it is a $K(\mathbb{Z}_k, n)$.
As for forming $K(\mathbb{Z}, n)$'s, there is a simple starting space, namely $X = S^n$ (which is $S^1$ suspended $n - 1$ times). Again, I do not know of an alternate description of the space you obtain from the above procedure applied to $X$, other than it is a $K(\mathbb{Z}, n)$.
For $n \geq 2$, a $K(G, n)$ only exists if $G$ is abelian. If in addition $G$ is finitely generated, then a $K(G, n)$ can be formed by taking products of the examples above (because $\pi_n(X\times Y) \cong \pi_n(X)\oplus\pi_n(Y)$).
For $n = 1$, if $G$ is abelian and finitely generated, then as before, you can just take a product of spaces constructed above to obtain a $K(G, 1)$. However, $G$ can be non-abelian, and taking products of the spaces above cannot produce a $K(G, 1)$ for $G$ not abelian. However, there is a simple way to construct a space $X$ with $\pi_1(X) = G$ which you can then apply the above procedure to in order obtain a $K(G, 1)$. Take a presentation for $G$. First form a bouquet of circles, one for each generator, and now attaching two-cells, one for each relation, with attaching map determined by the word used in the relation; this is the desired $X$ (which is sometimes called a presentation complex for $G$). Again, I do not know of an alternate description of the space you obtain from the above procedure applied to $X$, other than it is a $K(G, 1)$.