Let
$f\colon Y\rightarrow T$, $g\colon Y\rightarrow X$, $h\colon T\rightarrow S$, $i:X\rightarrow S$ be a cartesian diagram.
Then I have the diagonal morphism $\Delta\colon X \rightarrow X\times_SX$
and I also have a morphism $\phi\colon Y\times_TY \rightarrow X\times_SX$, given in natural way by the above data.
My question: what is the fibre product of $\Delta$ and $\phi$?
Is it just $\Delta\colon Y\rightarrow Y\times_TY$, the diagonal morphism of $Y$?
And another problem I have is: one can also consider $Y\times_SY$. Does this make a difference and what would I get then as fibre product of $\Delta$ and $\phi' Y\times_SY \rightarrow X\times_SX$?
So $Y=X\times_S T$. Then $$ Y\times_T Y \simeq (X\times_S T)\times_T (T\times_S X)\simeq X\times_S T \times_S X\simeq (X\times_S X)\times_S T.$$ Let $Z=X\times_S X$. Then $\phi$ can be identified with the projection $q: Z\times_S T\to Z$. Now for any morphism $r: X\to Z$, the fiber product of $q$ and $r$ is just $X\times_S T$. Similarly for $\phi$'.
There are a lot of (canonical) identifications in the above arguments. It should also be possible to use a functorial point of vue by considering the sections of these scheme over an arbitrary $S$-scheme.