Given a group $G$ and $H,K \le G$,then :
$$\left|HK\right|=\frac{\left|H\right|\left|K\right|}{\left|H \cap K\right|}$$
Where $HK:=\left\{hk:h \in H ,k \in K\right\}$
Lemma:
For $h_1,h_2 \in H$
$$hK=h'K \iff h(H \cap K)=h'(H \cap K)$$
We have:
$$HK=\bigcup_{h \in H}hK$$
Not every such left cosets of $K$ in $H$ are distinct, on the other hand the function $\phi:hK \to K$ with $hk \mapsto k$ is a bijection, so the number of elements in $hK$ is the same as that $K$'s I showed that the set of left cosets (equivalently right cosets) partitions the group.
By this we see that :$$\left|HK\right|=\left|\color{blue}{\text{the set consiting of all distinct left cosets }}hK\right|\left|K\right|$$
One concludes from the lemma that the number of such distinct left cosets is the same as $\left|H: H \cap K\right|$ but I don't know how such a conclusion is possible, how the lemma helps us?
It looks that $hK \ne h^{'} K$ iff $h(H \cap K) \ne h^{'}(H \cap K)$ and the order of the set of all such distinct $h(H \cap K)$ for $h \in H$ is $\left|H: H \cap K\right|$...
Also, it would be appreciated if someone gives me an example where such left cosets $hk$ are identical.
You noted that in the union $\bigcup_{h \in H} hK$, some cosets appear more than once. If you are able to show that each distinct coset appears $|H \cap K|$ times in the union, then you can arrive at the desired conclusion.
The lemma implies that the only way $hK=h'K$ can happen (for $h,h' \in H$) is if $h' = gh$ for some $g \in H \cap K$. In particular, for a given coset $hK$, it appears in the union $|H \cap K|$ times as $(gh)K$ for each $g \in H \cap K$.