$Y\mathbf1_{\\{Z=i\\}}$ stands for the product of random variable $Y$ and random variable $\mathbf1_{\\{Z=i\\}}$.
The second one takes value $1$ if $\omega\in\\{Z=i\\}$ (or equivalently if $Z(\omega)=i$) and takes value $0$ otherwise.
So $Y\mathbf1_{\\{Z=i\\}}$ is prescribed by $\omega\mapsto Y(\omega)$ if $Z(\omega)=i$ and $\omega\mapsto0$ otherwise.
This calculation of expectation of $Y$ must be made "under condition $Z=i$".
So we are simply not interested values taken by $Y$ for $\omega\
otin\\{Z=i\\}$.