How to distinguish different electrons?

Suppose in the system of two electrons, can you use the electron spin to distinguish the electrons. In the whole system of particles,where the electrons are swapped,the quantum state of the system changes, why is the electron still indistinguishable?

Two electrons are indistinguishable if all of their quantum numbers are equal. Therefore, if you apply a magnetic field and prepare one electron in the $m_s = +\frac{1}{2}$ state and one in the $m_s = -\frac{1}{2}$ state, their quantum numbers are not equal. Hence, they are distinguishable, if you do not allow spin-flipping collisions.