The device you're talking about is called a buck converter. They're commonly used in golf carts to run 12 volt lights, here's one that seems to sell very well on Amazon
Something like this:
10A converter:
https://www.amazon.com/Voltage-Regulator-Converter-Waterproof-Transformer/dp/B07V9D6SF2/
20A converter:
https://www.amazon.com/Kohree-Converter-Regulator-Transformer-Waterproof/dp/B09GXXQZ6P
You need to read the maximum current that the motor draws, to see if 10A or 20A (that means 120W or 240V) is sufficient, or you need something bigger. If not sure, go bigger.
Yes, they say 24V input, but IMO they will work for 18V too. Worse case, you return them.
They state: "Wide input voltage from 18V to 35V"