The battery you need is CR2032 or at least that is what Energizer lists it as. It's smaller than a nickel, but larger than a dime. I bought it at WalMart in the electronics department. It was hanging in the battery display by the watch and hearing aid batteries on a card with two in the pack. You could probably get it at a drug store as well.
Once you buy the battery, unscrew the back, slide out the old one and replace it, then screw the back on. There is a small recessed button on the back of the Tamagotchi. GENTLY poke it with a pencil point, toothpick, paperclip whatever. The screen will say "dowload" or "reset" pick "download" and your Tamagotchi will come back just as you left it.
Hope that helps! I've had to change the battery on all three of ours within a few weeks of buying them and it all worked out fine.
Good luck and I hope that helps!
Mom G