As said in comments, you can't "divide both sides" by a number non-coprime to the modulo. In other words, you can't divide by any number $n$ such that $\gcd(n, 8) \ne 1.$
We can think of what modulo means. We need to find $x$ such that $6$ times $x$ leaves a remainder of $2$ when divided by $8$. Any number divided by $8$ can be expressed as $8n$. So we can make an equation: $$6x-2=8n.$$
Now, we are allowed to divide by $2$, since this is just a simple arithmetic equation. We have $$3x-1=4n.$$
We know that $0\le x \le 7$, since if $x$ is over $7$, for example $8$, then it's pretty much the same as $x=0$, since the mod starts over at $8.$
We can just plug in the numbers now for $x$. A way to save time is to note that $4n$ is always even, and so $3x$ must be odd, since we add $1$ to $3x$, making the LHS even.
So $3x$ is odd, which means $x$ is odd. Therefore we check the values $$x = {1, 3, 5, 7}.$$
Simply plugging each value in, we find that when $x=3, n=2$ and when $x=7, n=5$. The only two numbers that matter here are $x=3$ and $x=7$, since those are going to be the modulos. Going back to the original mod equation, we have the $\pmod{8}$, so our answers are $$x\equiv 3\pmod{8}, x\equiv 7\pmod{8}.$$
Hopefully that made sense. I tried to go step by step but if it didn't make sense, please ask questions!