Solid state relay (SSR) - alternating polarity
I would recommend an H-bridge driver.

If you've not familiar with them, they typically are implemented in a single IC or an IC with external power FETs, depending on the current you want. I don't know your load current but I'd guess it'll suit the former, a single IC.

Have a look at the ONSemi NCV7729 (5..28 V, 8 A) or ST L9958 (4..28 V, 8.6 A) to give you some ideas.