If your tamagotchi runs out of batteries, it is best to buy a watch battery for it. Nearly every watch battery will work on your tamagotchi. I got a battery that says "CR2032 3 volts" on it.
I hope it helped and I would like to say thank you to sk8er girl for giving me the information. :huh...