Write $\vec{a}=(3,2,-6)$ as the sum of two vectors, one parallel, and one perpendicular, to vector $\vec{d}=(2,-4,1)$. The solution is $$\vec{a}=(-8/21)\vec{d}+(79/21,10/21,-118/21)$$

Consider the vector
$$
v=a-\frac{a\cdot d}{d\cdot d}d
$$
Note that
$$
\begin{align}
v\cdot d
&=a\cdot d-\frac{a\cdot d}{d\cdot d}d\cdot d\\
&=0
\end{align}
$$
Therefore,
$$
a=v+\frac{a\cdot d}{d\cdot d}d
$$
where $v$ is perpendicular to $d$ and $\frac{a\cdot d}{d\cdot d}d$ is parallel to $d$.
