$$ \begin{aligned} -2x+1 &= -x+7&& \text{move the $ \color{blue}{ -x } $ to the left side and $ \color{blue}{ 1 }$ to the right} \\[1 em]-2x+x &= 7-1&& \text{simplify left and right hand side} \\[1 em]-x &= 6&& \text{switch signs on both sides} \\[1 em]x &= -6&& \\[1 em] \end{aligned} $$