I'm trying to calculate the fundamental group of a surface using (i) deformation retracts and (ii) Van Kampen's Theorem. I'm really struggling understanding the group theory behind it and the interactions behind the different fundamental groups involved ($\pi(U), \pi(V),$ and $\pi(U\cap V)$). I would really appreciate it if someone could help me understand this.
I am trying to calculate the fundamental group of the following figure:
The deformation retract of this figure is shown below. Using Van Kampen's Theorem then, I choose $U$ to be the open region consisting of one triangle and a portion of the line segment connecting the two (the green region in the figure below), and similarly for $V$ (the red region in the figure below).
$\pi(U\cap V)$ is trivial, as $U \cap V$ may be deformed to a point which has a trivial fundamental group. For $U$ and $V$, either of these may be continuously deformed to a shape with fundamental group isomorphic to the integers, or the free group on $1$ generator. It's not particularly clear to me how this helps us find $\pi(X)$, and how the relations on each fundamental group can be translated to relations on $\pi(X)$.