1. The power pack
Most modern controllers take a mains power supply and run the track from that. Older systems, and many entry-level sets, run on a pack of cells in the controller or in a separate trackside box.
2. What cells they use
AA or AAA cells, either alkaline or NiMH, are the most common. Some controllers take a single 9-volt, and some sets use a proprietary pack. The battery door or the trackside box says which.
3. Rechargeables suit a running layout
A layout that runs for hours at a time drains a set of alkaline cells quickly. Low self-discharge NiMH cells hold their charge between sessions and can be charged hundreds of times, which makes them the better choice for a layout that runs often.
4. Change them in sets
Replace all the cells together, with the same type and about the same age. A controller running on one old cell and five new ones can behave oddly, and the weak cell is what leaks.
5. The cells by the track
A trackside battery box is outside, often in a shed or a garden, where the cells see cold and damp. Lithium AA cells cope much better with the cold, and a sealed pack in a waterproof box is the tidiest answer.