Find eigenvalues of $T$ and find a basis $\beta$ for $P_2(\mathbb{R})$ such that$[T]_\beta$ is a diagonal matrix. $T(f(x)=3f(x)+xf'(x)+xf''(x)$ what I did was, $T(1)=3+0+0=3,T(x)=3x+x+0=4x,T(x^2)=3x^2+2x^2+2=5x^2+2$, then $[T]_\beta=\begin{pmatrix}3&0&0\\0&4&0\\0&2&5\end{pmatrix}$ how should I continue after this?

Were you given a problem like this without knowing what eigenvalues and eigenvectors are?  That's very strange!
The eigenvalues satisfy the equation $\left|\begin{array}{ccc}3-\lambda & 0 & 0 \\ 0 & 4-\lambda & 0 \\ 0 & 2 & 5- \lambda \end{array}\right|= (3- \lambda)(4- \lambda)(5- \lambda)= 0$ so are 3, 4, and 5.
An eigenvector corresponding to eigenvalue 3 satisfies the equation $\begin{bmatrix} 3 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 2 & 5\end{bmatrix}\begin{bmatrix} x \\ y \\ z\end{bmatrix}= \begin{bmatrix}3x \\ 4y \\ 2y+ 5z\end{bmatrix}= \begin{bmatrix} 3x \\ 3y \\ 3z \end{bmatrix}$ so 3x= 3x, 4y= 3y, and 2y+ 5z= 3z.  The first equation, 3x= 3x, is t ue for all x.  4y= 3y is only true for y= 0, and 2y+ 5z= 5z- 4z is only  true for z= 0. So the eigenvectors corresponding to eigevalue 3 are of the form $\begin{bmatrix}x \\ 0 \\ 0 \end{bmatrix}= x\begin{bmatrix}1 \\ 0 \\ 0 \end{bmatrix}$.
Do the same to find eigenvectors corresponding to eigenvalues 4 and 5.

