Find basis so Transformation Matrix will be diagonal $e_1,e_2$ will be basis for $V$. $W$ has a basis $\{e_1+ ae_2,2e_1+be_2\}$. Choose an $a,b$ s.t. that the basis for $W$ will have a transformation matrix $T$ will be in diagonal form.
$T(e_1) = 1e_1+5e_2$
$T(e_2) = 2e_1+4e_2$
$V$ and $W$ are linear spaces of dimension $2$.

In the basis for $V$,
$$T_{[V]} = \left(\begin{matrix}
1 & 2 \\
5 & 4 \end{matrix} \right)$$
If you want the transformation $T$ written in $W$'s basis to be diagonal, then you want each basis vector of $W$ to be mapped to some multiple of itself:
$$T_{[W]} = \left(\begin{matrix}
\lambda_1 & 0 \\
0 & \lambda_2 \end{matrix} \right)$$
You know that $T : e_1 \mapsto e_1 + 5 e_2$ and $T : e_2 \mapsto 2e_1 + 4e_2$. Using this, you can solve for $a$ and $b$ by stipulating that:
$$e_1 + a e_2 \mapsto \lambda_1 e_1 + \lambda_1 a e_2,$$ 
$$2 e_1 + b e_2 \mapsto \lambda_2 2 e_1 + \lambda_2 b e_2$$
Appling the map $T$:
$$T_{[V]} \left( \begin{matrix}
1 \\
a \end{matrix} \right) = \lambda_1 \left( \begin{matrix}
1 \\
a \end{matrix} \right) = \left( \begin{matrix}
1 \\
5 \end{matrix} \right) + a\left( \begin{matrix}
2 \\
4 \end{matrix} \right)$$
$$T_{[V]} \left( \begin{matrix}
2 \\
b \end{matrix} \right) = \lambda_2 \left( \begin{matrix}
2 \\
b \end{matrix} \right) = 2\left( \begin{matrix}
1 \\
5 \end{matrix} \right) + b\left( \begin{matrix}
2 \\
4 \end{matrix} \right)$$
We've ended up with simultaneous equations for $\lambda_1$ and $\lambda_2$:
$$\begin{cases}
\lambda_1 = 1 + 2a \\
a \lambda_1 = 5 + 4a
\end{cases},\quad \quad \begin{cases}
2\lambda_2 = 2 + 2b \\
b \lambda_2 = 10 + 4b
\end{cases}$$
Rearranging these equations gives two quadratics:
$$2a^2 - 3a - 5 = 0$$
$$b^2 - 3b - 10 = 0$$
Our solutions are $a = 5/2$ or $-1$ and $b = 5$ or $-2$. Any of these four possible configurations will make $T$ written in $W$'s basis be a diagonal matrix.
As an example, set $a = -1, b = 5$. Then:
$$\underbrace{\left( \begin{matrix}
1 & 2 \\
5 & 4 \end{matrix} \right)}_{T_{[V]}} \left( \begin{matrix}
1 & 2 \\
-1 & 5 \end{matrix} \right) = \left( \begin{matrix}
-1 & 12 \\
1 & 30 \end{matrix} \right)$$
It can be seen that the first basis vector of $W$ is an eigenvector of $T$ with eigenvalue of $-1$, and the second is an eigenvector of $T$ with eigenvalue $6$.
Thus:
$$T_{[W]} = \left( \begin{matrix}
-1 & 0 \\
0 & 6 \end{matrix} \right)$$
With this choice for $a$ and $b$.
