I was studying time complexity where I found that time complexity for sorting is $O(n\log n)=O(n^2)$. Now, I am confused how they found out the right-hand value. According to this $\log n=n$. So, can anyone tell me how they got that value?
Here is the link where I found out the result.
$f(x)=\mathcal{O}(g(x))$ means that $f$ is asymptotically smaller or equal to $g$. This means that $|f(x)|\le c|g(x)|\quad \forall x$ for some constant c.
Now in your example, $$n\log n \le n^2$$
This does not say that $n=\log n$, but instead, that $\log n\le n$. In other words, that $\log n$ is asymptotically smaller or equal to $n$, or, in Big-O notation, $\log n = \mathcal{O}(n)$.