This is what I have done.

\(\displaystyle (-4x+i)+(2-3yi)=6-2i\)

Group real numbers and imaginary numbers

\(\displaystyle (-4x+2)+(i-3yi)=6-2i\)

\(\displaystyle \Rightarrow\) Solve for real number

\(\displaystyle -4x+2=6\)

\(\displaystyle -4x=4\)

\(\displaystyle x=-1\)

\(\displaystyle \Rightarrow\) Solve for imaginary number

\(\displaystyle i-3yi=-2i\)

\(\displaystyle 3yi=3i\)

.. Can someone verify if it's legal to divide both sides by \(\displaystyle 3i\)?

Yes, the division by \(\displaystyle i\) is legal. However, these sorts of problems are easiest if you realise that for two complex expressions to be equal, their real parts have to be equal and their imaginary parts have to be equal.

So if you write each side in terms of its real and imaginary parts, then you can equate real and imaginary parts.

In your case:

\(\displaystyle (-4x+i)+(2-3yi)=6-2i\)

\(\displaystyle -4x + 2 + (1 - 3y)i = 6 - 2i\)

Now equate real and imaginary parts:

\(\displaystyle -4x + 2 = 6\) and \(\displaystyle 1 - 3y = -2\).