I know the rotation matrix about main axis are
But I'm asking for rotation about an arbitrary direction for example about a given arbitrary direction modified by $n$. thanks in advance.
The thing you almost surely want is Rodrigues' Formula, which for a given length-one vector $v = (a, b, c)$ and angle $\theta$ gives the matrix for rotation of angle $\theta$ around $v$. (It also expresses this rotation in terms of cross products, which may prove more useful than the matrix form.)
If $r$ is a line of $\mathbb{R}^3$ passing through the origin, $e_1$ an unitary vector in the direction of $r$ and $B=\{e_1,e_2,e_3\}$ an orthonormal basis of $\mathbb{R}^3$ such that $e_1\times e_2=e_3$, it can be proved that the rotation matrix with angle $\alpha$ and axis $r$ is $$G=E\begin{bmatrix}{1}&{0}&{0}\\{0}&{\cos \alpha}&{-\text{sen }\alpha}\\{0}&{\text{sen }}\alpha&{\;\;\cos \alpha}\end{bmatrix}E^T,\quad E=\begin{bmatrix}{e_1},e_2,e_3\end{bmatrix}.$$