First, by the fact $p(A, B \mid C) = p(A \mid B, C)\cdot p(B\mid C)$, we have $$ p(w \mid y, X) = \frac{p(y \mid w, X) p(w \mid X)}{p(y \mid X)} \tag{$1$} $$ Next, since $w$ is independent of $X$, we have $$ p(w \mid X) = p(w) \tag{$2$} $$ Combining $(1)$ and $(2)$, you can get the second line.