How is a transistor used as a switch?

A transistor (bipolar junction transistor BJT) will only conduct in ONE DIRECTION.

And the voltage drop is not Ohmic - it is *NOT* strictly related to current flow.

If you're referring to a Field-Effect Transitor (JFET, IGFET, MOSFET, etc), then the device may be able to be used in a bidirectional circuit.

But the question stated "transistor", which is understood to be a BJT.