$$ \begin{aligned} 4 &= \frac{x}{2}&& \text{multiply ALL terms by } \color{blue}{ 2 }. \\[1 em]2\cdot4 &= 2 \cdot \frac{x}{2}&& \text{cancel out the denominators} \\[1 em]8 &= x&& \text{ swap the left and right side of the equation } \\[1 em]x &= 8&& \\[1 em]x &= 8&& \\[1 em] \end{aligned} $$