Why do we need a unit vector? I am taking a course in dynamic mechanics. It includes a lot of vectors. A vector by definition has a direction and a magnitude. But I don't get it on why we have to find a unit of it to find the direction of a vector.
Could you also please give an example in which where it would be useful?
Most of my searches about the unit vector have resulted in it referring to it (1) being a subset of a superset vector with it only having a magnitude of one of the original vector; and (2) that it is used to separate the magnitude and the direction.
My question is: why do we need to separate it when we already have both of them given on the main vector?
 A: You can't even properly write down a vector in cartesian coordinates without unit vectors. Suppose we have a vector
$\bar v = 1\hat i + 2\hat j + 3\hat k$
Right there, we have $\hat i$, $\hat j$, and $\hat k$ which are unit vectors. It specifies direction without influencing magnitude. If you didn't specify your coordinate system with a unit vector, the directions and magnitudes of everything in the coordinate system would always be changing.
That could end the discussion right there.
Expanding on that, a vector combines magnitude and direction but this is sometimes counter productive. When that happens, we break up the vector into it's magnitude and direction:
$\bar v = 1\hat i + 2\hat j + 3\hat k=\sqrt{14} (\frac{1}{\sqrt 14} \hat i+ \frac{2}{\sqrt 14} \hat j + \frac{3}{\sqrt 14} \hat k)$
This puts it $\bar v$ into the form $|\bar v|\hat u$,
where the magnitude is $|\bar v| = {\sqrt 14}$,
and the direction (unit vector) is $ \hat u = (\frac{1}{\sqrt 14} \hat i+ \frac{2}{\sqrt 14} \hat j + \frac{3}{\sqrt 14} \hat k)$
One example where this might happens is that you are solving for the magnitude of a vector but already know what direction it should be in. Perhaps that direction is a constraint of the system or perhaps you need to calculate a component or projection. If unit vectors did not exist, you would be unable to solve for the magnitude because instead of having one unknown (just $|\bar v|$), now you have three ($v_x\hat i + v_y\hat j + v_z\hat z$).
A: Suppose you are given the velocity vectors of two cars: $\vec{v_1}(t)$ and $\vec{v_2}(t)$ as a function of time $t$, and I pose you the following two questions:

*

*Which of the cars is driving faster at a certain time $t_0$?

*Which of the cars is turning faster at a certain time $t_0$?

To answer those questions correctly, you will need to distinguish between the magnitude of the velocity vectors at a given time, and the rates of change of their direction at a given time. This is just one example where making that separation is necessary.
A: Mathematically, a vector is not a thing with a magnitude and direction. Loosely, a vector space is a set of things that behave like little arrows when you add them together and multiply them by numbers. Rigorously there are $8$ rules that define this behavior. See https://en.wikipedia.org/wiki/Vector_space. It gives examples of vectors that look like little arrows, and some that do not but never the less add together the right way.
The definition does not include a length. Mathematically, length is a separate property with a separate definition. It is a norm. See https://en.wikipedia.org/wiki/Normed_vector_space for the definition and examples. Note that there are many ways to assign a number that represents the "length".
Mathematicians study abstract ideas. They find vectors without norms useful. They find uses for unusual norms.
But physicist study the behavior of the universe. They are interested in measuring distances and other physical things. Distances, velocities, accelerations, forces, electric fields, and many other things add together like vectors. For this reason, physicists find little arrow vectors very useful. The length is a big part of why they are useful. If length is defined in the usual way, the length of the vector represents the magnitude of a distance, just like the direction of the vector represents the direction of the distance.
Likewise, they find ordered triplet vectors useful. Ordered triplets are useful for calculating. Little arrows are useful for visualizing. Both are stand ins for something that physicists measure.
The key is that the length of the vector matches up well with measured values. Physicists just about never use a vector space without a norm. As RC_23 said in the comments - Do you ever find it useful to say "I am traveling North" as opposed to "I have traveled 16 miles North of some location"?

As @Amit notes, there are more examples. In quantum mechanics, vectors represent the state of a system as a superposition of basis states. The magnitude^2 of this vector is the probability of finding the system in this state.
Often the basis states are eigenstates of an operator. Making a measurement puts the state into one of the basis states and the measured value is the eigenvalue of that eigenstate. Normalization is important here because the system has to have a probability of 1 of being in put into some basis state.
In this case, the vector space has as many dimensions as there are basis states. It can be infinite dimensional.
In relativity, vectors are 4 dimensional. The magnitude usually has an obvious meaning for an object at rest in an inertial frame. For example, a displacement vector has distance and time components. For an object at rest, the distance is $0$, and the time component is the time interval between the start and end events.
A crucial property is that the magnitude of vectors are invariant under coordinate transformations to different inertial frames. These are transformations to the rest frame of a moving observer. In classical physics, the moving observer can calculate his coordinates from the stationary observer's like this: $x^{'} = x + vt$. It is more complex in special relativity, and the magnitude has a different form than the usual classical magnitude. The moving observer is see the object as moving and using a slowed clock. So he will measure different distances and time intervals for the displacement between the same two events. But he can calculate the proper time that the rest observer measures by calculating the magnitude if the displacement as he measures it.
A: First : You do not need a unit vector to find its direction. Often it is very practical to see the magnitude of a vector immediatly, if you want for example to compare a acceleration  in some direction with g it is nice to have  the magnitude and direction separate. If you have a speed of 7m/s  in the direction (4,3) you want to write s=7m/s*(4/5,3/5)*t
so there is no obligation to use unit vectors, but in many cases it is more convenient.
A: There are many cases where you only need the magnitude or the direction of a vector.
Example 1.
You want to project a vector $\vec u$ onto a vector $\vec v$. The length of the projection is given by $|u|\cos\theta$. You can calculate this with the dot product using
$$|u_\parallel|=\frac{\vec u\cdot\vec v}{|v|}=\frac{|u||v|\cos\theta}{|v|}$$
To calculate the projection vector itself we need to construct a vector whose direction is along $\vec v$ but whose length is $|u_\parallel|$. This becomes
$$\vec u_\parallel=\left(\frac{\vec u\cdot\vec v}{|v|}\right)\left(\frac{1}{|v|}\vec v\right)=\frac{\vec u\cdot \vec v}{|v|^2}\vec v$$
Alternatively we could have written this as
$$\vec u_\parallel=(\vec u\cdot\hat v)\hat v$$

Example 2.
Basis vectors often have unit length. If they don't have unit length they would introduce annoying scaling factors and we don't want that. An interesting example is the Frenet-Serret frame. This frame is used for parametric curves and it defines a basis based on the tangent vector and its normals.
Given some curve $\vec x(t)$ in 3D space we can calculate its tangent vector by normalizing the velocity $$\vec T(t)=\frac{\vec x'(t)}{|x'(t)|}$$. We can then form a normal vector from the tangent by repeating this procedure once more $$\vec N(t)=\frac{\vec T'(t)}{|T'(t)|}$$
One can proof that this vector is perpendicular to $\vec T$ because it has a constant length. Finally we can construct the final basis vector by taking the cross product of these two $\vec B=\vec T\times \vec N$. Each of these vectors has unit length so we have a nice basis.

Example 3.
In this example we will look at an arbitrary (2D) position vector in polar coordinates and calculate the second derivative with respect to time. This calculation is often used to derive the Coriolis force. We can split a position vector, given by $\vec r=(x,y)=r(\cos\theta,\sin\theta)$, into its length and direction:
$$\vec r=r\,\hat r$$
If we calculate the derivative we get a product rule.
$$\dot {\vec r}=\dot r\,\hat r+r\,\dot{\hat r}$$
We can calculate the time derivative of $\hat r$:
$$\dot{\hat r}=\frac{d}{dt}(\cos\theta,\sin\theta)=(-\sin\theta,\cos\theta)\dot\theta$$
Define this last vector as $\hat \theta$:
$$\hat \theta=(-\sin\theta,\cos\theta)$$
The reason for this name is roughly speaking that $\hat r$ points in the direction of increasing $r$ and $\hat\theta$ points in the direction of increasing $\theta$. You can show that $\dot{\hat\theta}=-\hat r\dot\theta$. Now we can calculate the second derivative of $\vec r$.
\begin{align}
\frac{d^2}{dt^2}\vec r&=\frac{d}{dt}\left(\dot r\hat r+r\dot\theta\hat\theta\right)\\
&=(\ddot r-r\dot\theta^2)\hat r+(2\dot r\dot\theta+r\ddot\theta)\hat\theta
\end{align}
A: 
A vector by definition has a direction and a magnitude, I don't get it on why we have to find a unit of it to find the direction of a vector.

Mathematically, this means that any fector $\mathbf{F}$ can be written as
$$
\mathbf{F}=F\mathbf{n},\text{ where }\mathbf{n}=\frac{F}{F},F=|\mathbf{F}|,
$$
whete $F$ is the magnitude of a vector and $\mathbf{n}$ is its direction.
We can now introduce other vectors that may have the same direction but different magnitude, e.g.,
$$
\mathbf{F}_1=F_1 \mathbf{n}
$$
or same magnitude by different direction, like
$$
\mathbf{F}_2=F\mathbf{m}.
$$
In other words, we can operate the magnitude and the direction of the vector independently. E.g., we could decompose the direction vector (i.e., the unit vector) in terms of other (unit) vectors:
$$
\mathbf{n}=x\mathbf{i}+y\mathbf{j}+z\mathbf{k}.
$$
A: You'll find plenty of examples from classical, introductory mechanics and physics.
For instance, you will often need to extract the components of a vector, such as a force vector or a velocity vector. Maybe you need the component of a force vector that pulls up along a tilted incline.
To find this, simply compute the dot product of the force vector $\mathbf F$ and a unit direction vector $\mathbf e$ up along the incline:
$$\mathbf F_\text{along incline}=\mathbf F\,\cdot\,\mathbf e\,.$$
In this context the strength of a unit vector is that it can point out a direction "without influencing" the magnitude of the other vector, so to speak. This is a need you will run into often when working with classical mechanical box-on-incline scenarios.
As another example, consider the many difference force formulae that we know from various natural laws, e.g. Newton's law of gravitation or Coulomb's law of electric field strength as examples:
$$F_g=G\frac{Mm}{r^2}\qquad\text{and}\qquad E=\frac{1}{4\varepsilon_0\pi}\frac Q{r^2}\,.$$
These formulae provide magnitudes. The gravitational force magnitude and the electric field strength. If you, when you know the magnitude of a force or a field (or of a velocity or an impulse or a momentum or...), want not just this magnitude but the full vector, then simply multiply the magnitude with a unit direction vector $\hat r$ that points in the rigth direction:
$$\mathbf F_g=G\frac{Mm}{r^2}\hat r\qquad\text{and}\qquad \mathbf E=\frac{1}{4\varepsilon_0\pi}\frac Q{r^2}\hat r\,.$$
So, many simple usecases before we dive into any of the more advanced topics. A unit vector definitely earns its right to be include in the good company of terms we have defined.
A: I think that the main reason is to avoid making errors when adding or subtracting vectors.
By writing
$$\mathbf{F_1}=F_1\mathbf{n_1},\text{ where } F_1=\mathbf{|F_1|} \text{  and  }  \mathbf{n_1}=\frac{\mathbf{F_1}}{F_1}$$
$$\mathbf{F_2}=F_2\mathbf{n_2},\text{ where } F_2 = \mathbf{|F_2|} \text{  and  }  \mathbf{n_2}=\frac{\mathbf{F_2}}{F_1}$$
we can safely separate the directional and magnitudinal aspects of the two  vectors on paper as well as (forgettably) in our own mind.
This prevents us from incorrectly adding them as if they were scalar quantities, something we can only do when both $\mathbf{n_1} $ and $\mathbf{n_2} $ are equal.
Of course, we do not need to do this if we take proper care when doing these operations or if we use the same component basis, e.g. $\mathbf{i}$ and $\mathbf{j} $ vector components for each vector that we use, e.g.
$$\mathbf{F_1}= a_1\mathbf{i} + b_1\mathbf{j}$$
$$\mathbf{F_2}= a_2\mathbf{i} + b_2\mathbf{j}$$
$$\mathbf{F_1} + \mathbf{F_2} = (a_1 + a_2)\mathbf{i} + (b_1 + b_2) \mathbf{j}$$
On the other hand, we do not always have a ready $\mathbf{i}$ and $\mathbf{j} $ base vectors for these vectors so each vector has to be self-referential: the vector must then be defined on its own unit vector and addition of such vectors can be expressed in terms of the unit vectors of the individual vector terms, e.g.
$$ \mathbf{F} = \mathbf{F_1} + \mathbf{F_2} = F_1\mathbf{n_1} + F_2\mathbf{n_2}$$
Just see unit vectors as one way of writing vectors that is sometimes useful when adding things like similar forces with each force acting along a different line of action and where there is no convenient common basis for resolving the vectors concerned into components.
It may also be useful when differentiating/integrating a vector quantity that is resolved into mutually normal components.
