Let $S_{n}=\sum_{k=1}^{n}X_{k}$ and $T_{n}=\sum_{k=1}^{n}Y_{k}X_{k}$ with all $X_{k}$ and $ Y_{k}$ are mutually independent and of law Bernoulli respectively of parameters p and q. Let $N=inf\{n>0 \mid T_{n+1}=1\}$
The question is to show that for all k , we have
$P(X_{k} \mid N=n)=P(X_{k} \mid Y_{k}X_{k}=0)$ for all k and $P(\cap_{k=1}^{n}(X_{k}=x_{k} \mid N=n)=\prod_{k=1}^{n} P(X_{k}=x_{k} \mid N=n)$ for all $x_{k} \in \{0, 1\}^{n}$.
The event $[N=n]$ tells you that $X_kY_k=0$ for $k=1, \ldots, n$. Because the variables are independent, $X_jY_j$ is not informative about $X_k$ unless $j=k$, so \begin{align*} P[X_k=1\mid N=n] &= P[X_k=1\mid X_1Y_1=0, \cdots, X_nY_n=0] \\ &= P[X_k=1\mid X_kY_k=0]\\ &=P[Y_k=0]\\ &=1-q. \end{align*} This reasoning can be extended for each $k$, again by independence, so \begin{align*} P[X_1=x_1, \ldots, X_n=x_n \mid N=n] &= P[X_1=x_1, \ldots, X_n=x_n \mid X_1Y_1=0, \ldots X_nY_n=0]\\ &= P[X_1=x_1\mid X_1Y_1=0] \cdots P[X_n=x_n|X_nY_n=0] \\ &= P[X_1=x_1 \mid N=n] \cdots P[X_n=x_n \mid N=n]\\ &= \prod_{k=1}^n P[X_k=x_k\mid N=n] \end{align*}