$X,Y,Z$ are random variables. How to construct an example when $X$ and $Z$ are correlated, $Y$ and $Z$ are correlated, but $X$ and $Y$ are independent?
Roll two dice.
X is the number on the first die, Z is the sum of the two dice, Y is the number on the second die
X and Z are correlated, Y and Z are correlated, but X and Y are completely independent.
(This is a concrete instance of the answer given by fblundun, but I came up with it before seeing their answer.)