I see that the question "why is my MacBook not charging?" gets asked a lot. The problem is, there are multiple reasons. Possible points of failure are: charger, cable, magsafe connector, DC input board, logic board, battery. (Have I missed any?).
What is the best sequence for the user diagnose the location of the problem?
By way of example, here are the first steps that I usually try:
Make sure the charger is working. Either use your charger on a different Mac, or test a spare charger with your Mac.
Check the connection. There might be gunk in your port that's stopping the connector from lying flat.
Try resetting the SMC and PRAM.
If the computer boots, run Coconut Battery to determine battery status.
This is where I get a bit stuck. For example, I have a machine here that boots fine when plugged in, but not from battery. Disconnecting the MagSafe causes the machine to switch off. Sounds like it's a dead battery, except that Coconut reports the battery as detected, in good condition, but not charging.
What steps should I take next? Specifically, I'm asking for a generic algorithm to help determine the source of the fault (preferably without swapping out lots of components one by one)?