Two 12-volt batteries wired together don't necessarily get you 24 volts; it all depends on the method you use to hook them up. To get 24 volts you need to hook up the batteries in series. Series wiring means that the voltage from each 12-volt battery is combined so the total output is 24 volts. The method for wiring in series is straightforward and...
M/F Put your two 12-volt batteries next to each so you can hook them up. Place them on a stable flat surface such as a table or workbench.
M/F Connect the metal clamp on one end of the battery cable onto the negative terminal of the first 12-volt battery. The battery terminal is clearly identified using a "-" symbol; it may also have a black plastic rim around the terminal. Use your hand to press the clamp handles together so the clamp opens then place over the terminal and release the pressure.
M/F Repeat the procedure for the clamp on the opposite end of the battery cable you've connected to the negative terminal of the first battery by connecting it to the positive terminal of the second battery. Look for the symbol "+", or a red plastic rim around the terminal. When you connect the wires from the 24-volt electrical equipment to the positive terminal of the first battery and the negative terminal of the second battery, the hooked up batteries produce the 24 volts you need.