There are two main ways to connect batteries: in series and in parallel.
When connecting batteries in series, the positive terminal of one battery is connected to the negative terminal of the next battery, effectively increasing the overall voltage of the system. For example, connecting two 12V batteries in series will result in a total voltage of 24V.
When connecting batteries in parallel, the positive terminals of all batteries are connected together, and the negative terminals are also connected together. This increases the overall capacity (ampere-hours) of the system, but the voltage remains the same. For example, connecting two 12V batteries in parallel will result in a total capacity of 24Ah, but the voltage will still be 12V.
It is also possible to connect batteries in a combination of series and parallel, called a "series-parallel" configuration, which allows for both increased voltage and increased capacity.
It is important to note that when connecting batteries in series or parallel, all batteries should be of the same type and capacity, and should be fully charged before connecting.