Let $f\colon Z\to X$ and $g\colon Z\to Y$ be functions. What is a pushout of $f$ and $g$ in $\mathsf{Set}$? Different sources and questions on this site claim that it's the quotient of the disjoint union $X\sqcup Y$ by the equivalence relation $\sim_R$ generated by the relation $R = \{ ((0,x),(1,y)) \in (X\sqcup Y)\times (X\sqcup Y) \mid \exists z \in Z, x = f(z)$ and $y = g(z) \}$.
Define functions $i_1\colon X\to X\sqcup Y/{\sim_R}$ and $i_2\colon Y\to X\sqcup Y/{\sim_R}$ by setting $i_1$ to map each $x \in X$ to the equivalence class $[(0,x)]$ and $i_2$ to map each $y \in Y$ to the equivalence class $[(1,y)]$.
For $X\sqcup Y/{\sim_R}$ together with $i_1$ and $i_2$ to be a pushout in $\mathsf{Set}$, we first must have $i_2\circ f = i_2\circ g$. It's easy to check that it's so.
Now, let $j_1\colon X\to Q$ and $j_2\colon Y\to Q$ be functions so that $j_1\circ f = j_2\circ g$. We seek a function $u\colon X\sqcup Y/{\sim_R} \to Q$. $u\circ i_1 = j_1$ and $u\circ i_2 = j_2$. Of course, for these identities to hold, this hypothetical function $u$ must satisfy $u([(0,x)]) = j_1(x)$ and $u([(1,y)]) = j_2(y)$ for any $x \in X$ and $y \in Y$. But I'm not sure how to prove that this data indeed defines a function. We need to prove that it is independent of the choice of $x$ and $y$. Of course, this needs to use the fact that $j_1\circ f = j_2\circ g$.