6. In $\triangle A B C$, $a, b, c$ are the sides opposite to $\angle A, \angle B, \angle C$ respectively. If $\frac{a}{b}+\frac{b}{a}=4 \cos C$, and $\cos (A-B)=\frac{1}{6}$, then $\cos C=$
6. $\frac{2}{3}$.

From the given condition and the cosine rule, we know
$$
\frac{a}{b}+\frac{b}{a}=4 \cdot \frac{a^{2}+b^{2}-c^{2}}{2 a b},
$$

Simplifying, we get $a^{2}+b^{2}=2 c^{2}$. According to the sine rule, we have
$$
\sin ^{2} A+\sin ^{2} B=2 \sin ^{2} C .
$$

And
$$
\begin{aligned}
\sin ^{2} A+\sin ^{2} B & =\frac{1-\cos 2 A}{2}+\frac{1-\cos 2 B}{2} \\
& =1-\cos (A+B) \cos (A-B)=1+\frac{1}{6} \cos C,
\end{aligned}
$$

Also, $\sin ^{2} C=1-\cos ^{2} C$, substituting into equation (1), we get
$$
1+\frac{1}{6} \cos C=2\left(1-\cos ^{2} C\right),
$$

Solving, we get $\cos C=\frac{2}{3}$ or $-\frac{3}{4}$. Since $\cos C+\cos (A-B)=-(\cos (A+B)-\cos (A-B))=2 \sin A \sin B>0$, we know that $\cos C=-\frac{3}{4}$ does not satisfy the condition, thus $\cos C=\frac{2}{3}$.