How much voltage and current to charge a 24V battery?
You need to get the voltage and current charge information for the battery. It may be written on the side of the battery, otherwise you'll have to look up the data from the manufacturer.

The numbers you're looking for are "float voltage" (more conservative) or "cycle voltage" (less conservative). The charge current may not be specified, but if it is then use it. If it is not, then "1C" is generally a safe charge current. To calculate 1C, get the capacity of the battery in amp-hours (often written "Ah"). It may be that the "18A" figure you state is actually "18Ah". Then replace "Ah" with "A" to get the "1C" charge rate. For example, if your battery has a capacitor of 18Ah, then the 1C charge rate is 18A.

Finally, and critically, when you put the two batteries in series you must double the charge voltage, but keep the charge current the same.

For example, suppose your float voltage is 13.8V and your 1C rate is 18A. Then to charge two batteries in series, apply a maximum voltage of 27.6V and a maximum current of 18A.

Remember, you can always make this safer by lowering the max current. I advise starting at 1/4C or lower and only increase to 1C if you really want fast charge and are well prepared to handle the potential heat and gas production. See Peter Bennett's 0.2C recommendation in the comments below.