1. The battery is a lithium-ion pack
It is built from 18650 cells or something similar, giving about 11.1 volts in a typical laptop. The pack is inside the case and is not meant to be opened.
2. Look at the cycle count
Most laptops report how many times the battery has been charged. A pack that has been through 800 to 1000 cycles is near the end of its life, whatever its age.
3. The battery health number
Phones and laptops report the capacity left as a percentage of what the pack held when it was new. Below about 80 percent is the usual point where a replacement is worth the money.
4. Calibrate it now and then
Charge it to full, use it until the machine shuts itself down, then charge it to full again without interruption. Doing that every few months tells the gauge how much charge is really left.
5. Buy the part that matches
A battery with a different shape or a different connector will not fit, and one with a different voltage can damage the laptop. Give the maker and the model number, and order the part that fits both.