Copying save files from Gameboy and Gameboy Colour games to a PC
Gameboy games have a pretty good shelf life, but the save file doesn't. The data that is kept when the Gameboy is turned off is kept thanks to SRAM, which needs to be powered in order to keep information. This is why we often heard of "battery back-up" in the days when Gameboys were common. Nowadays we have flash memory and don't need to worry so much, but with old cartridge based games (on any format, not just Gameboy) once the battery in the cartridge runs out your data is lost, and the game can't be saved again until the battery is replaced.
I'm not going into replacing batteries, it is possible, but it involves soldering onto a tiny PCB and a high risk of frying the game. But there is value in getting the save file off a cartridge and onto something more permanent, like a PC's hard disk.
If you're looking to save your poor Pokemon, you're probably too late, especially if you were into the second generation games (Gold, Silver and Crystal) as I was back in the day. The reason is that the batteries in those cartridges also had to power the realtime clock, meaning they run dry much faster.
Things to buy
A Flash Cart
A good thing for a Gameboy collector or homebrew dev to have anyway, there are loads of these about. They're essentially writable game cartridges with USB ports for plugging them into PCs. Back in the day, Nintendo used to shut down any retailer selling these things because their main purpose is to play pirated games, but these days I doubt they care as much, it's not like they're making any money from the Gameboy any more. The one everyone raves about is the EMS GB USB Smart Card, but these are, like pretty much everything made by EMS, a bit shonky, not to mention a real pain to get working on Windows 10 (or anything other than Windows XP for that matter). Retro Towers has a good selection of Gameboy flash carts, such as the Ever Drive and the Drag N Derp. The latter is by far the best in my opinion - it shows up as a flash drive under any PC OS, and you simply copy ROM files and save files to and from it on any OS, without needing any special software.
A Mega Memory
This is a J-shaped cartridge that plugs into the Gameboy and a normal game cartridge plugs into the other end. Once you plug it in and turn it on you can copy the save file from the game cartridge onto the Mega Memory's internal RAM, and restore it again later once you realise you didn't have everything you needed to beat that boss after all! A few points to note though - the Mega Memory has no PC connectivity, which is why we need the flash card. Secondly, not all flash carts work and there are two different products called Mega Memory, both of which look virtually identical but are made by different manufacturers! If you can get it, you'll need the translucent yellow coloured version, rather than the black Datel version. The black version simply refuses to recognise the EMS GB USB at all, although both versions are particularly badly made. I do have personal experience of the black model working well with the Drag N Derp, so once again I do recommend that particular flash cart.
Helpfully, there is a switch on the Mega Memory that makes it just work as a pass through. This is actually really helpful because if the contacts on the cartridge are bad (which they usually are on a 20 year old game cartridge), the game will not run but the Mega Memory will still attempt to copy/restore the SRAM anyway, resulting in a corrupt file! It's important to remember to check the game runs in passthrough mode before attempting any save or restore operations with one of these things. If you don't, at best you'll lose your save, at worst you could theoretically make the game unplayable.
Copying save states
The first thing to do is get the save onto the Mega Memory. This is easy enough - plug the game into the Mega Memory and plug the Mega Memory into a Gameboy. Make sure the game runs in passthrough mode as described above, and then turn off the Gameboy, flip the switch on the Mega Memory and turn the Gameboy on again to get the Mega Memory menu. Choose the backup option (top left) and enter a unique name for the save file (ideally the name of the game).
Once that's done, turn off the Gameboy and unplug the Mega Memory and the game. Now plug the flash cart into the Mega Memory, before plugging it into the Gameboy and powering on. This time choose the restore option (top middle) and wait for the Mega Memory to copy the save onto the flash cart.
Now the save is on the flash cart, you should be able to simply plug it into the PC and use the flash cart's method of transferring the save (SRAM) over to the PC. If you have the ROM of the game in question, try loading it in an emulator and restoring from the save file you've just extracted, to make sure the process worked. You should be able to continue from the point you saved on the physical Gameboy, albeit on the emulator.
Restoring save states
For backup purposes, we're done. But if you want to restore the game to its cartridge, just reverse the instructions. Maybe you've changed the battery for example, or just want to go back to a past position, or simply want to shift from emulated play back to genuine hardware. All you need to do is take the save file, copy it to the flash cart, then plug it into the Mega Memory, backup the save from the flash cart onto the Mega Memory, then put the original game into the Mega Memory and restore to that.