Which route you take depends on how you're playing.
If you're using an emulator and a ROM, the "internal battery has run dry" message is usually just a warning — most emulators save to the file instead, and there are guides such as https://www.vbalink.info/internal-battery-has-run-dry-fix.htm that walk you through it.
With a real cartridge, you'll have to open it up: undo the screw on the back, swap the CR1616 or CR2025 cell inside, and reseal it. Take care not to scratch the label or bend the contacts.