For $\vec{a},\vec{b},\vec{c}\in\mathbb{R}^{3}$,
$$\vec{a}\times(\vec{b}\times\vec{c})=\vec{b}(\vec{a}\cdot\vec{c})-\vec{c}(\vec{a}\cdot\vec{b})$$
where $\times$ denotes the cross product and $\cdot$ the dot product.[1]
Mnemonics: bac-cab: Ax(BxC)=B(AC)-C(AB)
Let $\vec{a}=a_1\hat i+a_2\hat j+a_3\hat k,\, \vec{b}=b_1 \hat i+b_2\hat j+b_3\hat k,\, \vec{c}=c_1\hat i+c_2\hat j+c_3\hat k$.
By definition,
$$
\vec{b}\times\vec{c}=(b_2c_3-b_3c_2,\; b_3c_1-b_1c_3,\; b_1c_2-b_2c_1).
$$
Now calculate the $\hat i$ term of the left-hand side:
$$
\begin{aligned}
\bigl(\vec{a}\times(\vec{b}\times\vec{c})\bigr)_{\hat i}
&=a_2(b_1c_2-b_2c_1)-a_3(b_3c_1-b_1c_3)\\
&=(a_2b_1c_2+a_3b_1c_3-(a_2b_2+a_3b_3)c_1),
\end{aligned}
$$
and the $\hat i$ term of the right-hand side:
$$
\begin{aligned}
\bigl((\vec{a}\cdot\vec{c})\vec{b}-(\vec{a}\cdot\vec{b})\vec{c}\bigr)_{\hat i}
&=(a_1c_1+a_2c_2+a_3c_3)b_1-(a_1b_1+a_2b_2+a_3b_3)c_1\\
&=a_1b_1c_1+a_2b_1c_2+a_3b_1c_3-a_1b_1c_1-(a_2b_2+a_3b_3)c_1\\
&=(a_2b_1c_2+a_3b_1c_3-(a_2b_2+a_3b_3)c_1),
\end{aligned}
$$
which is identical to the $\hat i$ term of the left handside.
Similarly, by simple calculation it can be demonstrated that the $\hat j, \hat k$ terms are identical on both sides as well.*
* Intuition: Vector space $\mathbb{R}^3$ has no preferred direction. There is nothing special about $\hat i$ compared to $\hat j$ or $\hat k$.