As a computer systems designer/engineer, after using my MacBook for a few months, I've developed a few helpful solutions for Apple MacBook users who are having problems with sudden power shutdown or with their battery:
Don't trust the battery indicator on the screen. I've seen it get stuck
at the wrong level for long periods of time. When in doubt, press the
little button on the battery to view the charge level directly.
If you do a shutdown, wait a few seconds before closing the lid. (Otherwise your Mac may continue running while the lid is closed and totally discharge the battery without you knowing it. See Serious MacBook Shutdown Power Problem.)
For the first few weeks of ownership, recharge your Mac every time you
use it. (And, it's a good practice all the time.)
Whenever possible, keep your Mac charging until the little power cable
light goes green.
If the battery seems hot, do not charge it. Wait an hour or more until
it cools down. Heat ruins batteries.
Avoid discharging the battery below 30% (when possible), otherwise you will shorten its lifespan.
To start charging, it is a good idea to disconnect the power cable and reconnect it. You may want to do this even if you normally keep your
Do not use or charge your MacBook on any surface that 1) blocks the
flow of air under it (e.g. avoid cloth, bed, pillow, seats) or 2) could catch on
fire. (Yes, that has happened to MacBook owners, and it is a bummer.)
If you are doing all this, and you think you still have a serious problem, by all means contact Apple Computer. If your dealer is treating you poorly, contact Apple directly. I've worked for Apple, and I know they really do care about their products and their users.
Disclaimer: No, I do not currently work for Apple, nor do they compensate me in any way. I'm just a lone "rebol".