I'm not quite sure where the $4$ came from. But as you said, you can reduce it to $$2x \equiv 1 \pmod 3.$$ In mod $3$, $2$ is the inverse of $2$, since if you multiply $2$ by $2$, you get 1, i.e. $2\times 2 \equiv 1 \pmod 3.$ So consider multiplying both sides of the equivalence by $2$. Then you get $$4x \equiv 2 \pmod 3.$$ But notice that $4x \equiv x \pmod 3,$ so you get that $$x \equiv 2 \pmod 3.$$
As another example, suppose you have that $$2x \equiv 1 \pmod 5.$$ Can you find the inverse of $2$ in mod 5, then solve the problem from here?
Actually, this notion of inverse is a little tricky. Consider the equation $$3x \equiv 1 \pmod 6.$$ This equation actually has no solutions, and the point here is that $3$ does not have an inverse mod $6$, so you can't multiply both sides of the congruence by a number to remove the $3$ on the left. In general, if you have a congruence $$ax \equiv b \pmod m,$$ you want to write $$x \equiv a^{-1} b \pmod m,$$ where $a^{-1}$ is the inverse of $a$. When $a$ and $m$ are relatively prime (meaning they have no factors in common), then $a$ will have an inverse mod $m$. In your question, you mentioned something about dividing both sides by 2. Division isn't really the right way to think about it; the right way to think about it is finding the inverse and multiplying both sides by it.