Hi,
A normal sailing ship is able to tack because it can use the keel and rudder of the boat to push against the water it sits on in a different direction to the wind.
I would imagine you could achieve a similar effect in space if you were able to push against the interstellar medium in some...