My thought process is that there is very little friction in space minus gravitational pull. Which could be a good thing if you wanted to go faster or slow down. The question is, is it possible to have a stong electo-magnet and grab onto the magnetic field of a random mass and use it to coast? Or to push away from the magnetic field of an object that is closer given that its gravity doesn’t pull you in?
So the short answer here is yes you could. However, there's not a justifiable advantage to using this. To propel yourself, you would constantly need an incredibly strong magnetic object near you. Now, electromagnetic forces are significantly stronger than gravity, but the extent of positive or negatively charged objects are relatively scarce. Additionally, the magnetic orientation of objects is also incredibly weak in general. Earth's magnetic field is 25-65 µT. To put that in perspective, a fridge magnet is about 1.5 mT and an MRI machine is about 1.5 T. This means that any force you could generate would be relatively small in comparison to the conventional Liquid Hydrogen and Liquid Oxygen reaction used. I can try to get the energy numbers if you need them, but I don't necessarily know how to go about calculating it properly. Regardless, the strength is likely 4 or 5 orders of magnitude ($10^4$ or $10^5$ times) weaker than conventional thrust methods.
Magnetic "sails" have been proposed, that would achieve thrust by deflecting charged particles in the solar wind with the magnetic field of a superconducting loop. Also possible to deflect off solar and planetary magnetospheres.
I don't have any way to judge the feasibility. What I've read suggests they would need higher temp superconductors than currently available, at least in the inner solar system. It sounded like the current should persist in the loop.
Magnetism is frequently used in the form of Magnetorquers , which use the Earth's magnetic field to rotate a spacecraft. Specifically, for that very gentle and continuous correction of misalignment that are caused by aerodynamic forces (yes, they exist!) on the satellite, asymmetric thrust from the sunlight falling on it, trace outgassing of components, and similar minute rotational deviations.
For this role, the magnetic forces are an excellent, zero-fuel, solid-state means for propulsion. But at such ludicrously low levels that they take days to have a measurable effect. Which is fine for fine attitude control, but not so good for commanded rotation (pointing a telescope, for example) where they are simply too weak.
The same forces could be used to actually propel a craft, but you are likely to die of old age before seeing a usable result, the magnitude of forces involved are simply too weak.
One way to increase the force is to throw power at it. a LOT of power. By generating a small but very strong magnetic field you get a bit more acceleration, at the cost of gonzo-loads of power consumption.
Another way to increase the force is to make your magnet bigger. By using a tether of many meters length, you could get a nice big magnetic field for a relatively smaller power investment. Unfortunately, tethers are long, difficult to deploy, heavy and prone to tangling. And still would require a hefty power source to use as a linear propulsion motor.
Of course, the effectiveness is directly proportional to the magnetic field density at the craft's position. So in LEO they work fine. AT GEO they work, but badly. And in interplanetary space, they are virtually useless.
So in short: