Proof (finitely presented group as fundamental group)
Let $\langle S\mid R\rangle$ be finitely presented, i.e. $S$ and $R$ are finite. Take $X = \bigvee_{|S|} S^1$, which is $|S|$-many copies of $S^1$ all with one point $*$ identified.
Seifert-van Kampen applied to $(\bigvee_n S^1) \vee S^1$ and inducting on $n$ gives $$ \begin{align*} π_1(X, *) \isom \langle S \mid\rangle. \end{align*} $$ which each element in $S$ corresponding to a loop around a different $S^1$.
For each $r\in R$, attach a 2-cell along a loop $γ_r$ such that $[γ_r]$ is identified with $r$. Call the resulting 2-dimensional cell complex $Y$.
Then by our result, $$ \begin{align*} π_1(Y, *) \isom π_1(X, *) / \langle \langle [γ_r]\mid r\in R\rangle\rangle = \langle S\mid R\rangle. \end{align*} $$