I am trying to solve an exercise from Vakil's lecture notes on algebraic geometry, namely, I want to show that $\require{AMScd}$ \begin{CD} X_1\times_Y X_2 @>>> X_1\times_Z X_2\\ @V V V @VV V\\ Y @>>> Y \times_Z Y \end{CD}
is a cartesian diagram. I think I've figured out where the maps come from: The lower map is the diagonal induced from the universal property of $Y \times_Z Y$, the upper map is coming from the universal property of $X_1\times_Z X_2$ (this is one of the previous exercises in Vakil's notes), the map on the right also comes from the universal property of $Y \times_Z Y$ since we have two maps from $X_1\times_Z X_2$ to $Y$ whose composition with $Y\rightarrow Z$ coincides, and finally the map on the left side is either composition $X_1\times_Y X_2 \rightarrow X_i \rightarrow Y$. At this point, I don't even see why this diagram should be commutative.
But even discarding the issue of commutativity, given some $T$ instead of $X_1\times_Y X_2$ making the above diagram commute, I have no clue how to obtain a canonical map $T \rightarrow X_1\times_Y X_2$.
I could solve all the other problems in this section of his notes, but this one eludes me. Any help or solution (preferably just using the universal properties that we're given) would be greatly appreciated.