Easiest is a two-pole changeover relay.
If the current and voltage are small you could use one or two op-amps with crossed inputs.
If the voltage is fixed and the current small, you could use logic gates.
Otherwise you could use a H-Bridge.
There are lots of solutions but 'direct current' could be Kilovolts or microvolts and at any current. The optimum solution needs more information.