If you own one of Apple's MacBook, MacBook Pro, or MacBook Air systems, you will have a power adapter that comes with the unit for charging it. Depending on your system, you may have a 60-watt adapter or an 85-watt adapter, which can be used to charge the system or run it directly from wall power; however, there are times when these adapters might not work properly.
Sometimes they get very hot when used, or sometimes they won't charge the system or show any activity at all.
While often the easiest solution for a faulty power adapter is to replace it with a new one, before doing this there are some steps you can take that will ideally address the problem.
If your adapter isn't working, the first thing you should do is unplug it for a while. Apple's adapters can get quite hot and do have a temperature sensor in them that will shut it off if it overheats. It's not uncommon for adapters to be put in poorly ventilated areas or to get shoved between the cushions of a couch or chair that insulates them and causes them to rapidly heat up.
In addition to heating, some wall circuits might have excessive line noise (voltage spikes and drop-outs) that occur too often for the adapter to manage. These spikes may trigger the adapter's over-voltage protection circuits which, similar to the temperature sensor, will shut off the adapter to prevent damage to the component circuitry.
When these features are triggered they may require time to reset and allow the adapter to work again. Therefore, try unplugging the unit both from the wall and from your computer, and setting it in a cool place for about 5-10 minutes to see if it works again. For poor wall circuits, you can try using another circuit (it may be best to go to a completely different building, such as a public library) or use a uninterruptable power supply (battery backup) to provide a smoother and conditioned power signal to the adapter.
If a battery backup clears the problem, then you may have to continue using it until you can have an electrician clear up the line noise issues you are experiencing.
Beyond these two reasons, the adapter may have poor cabling, which can include broken cables and dirty or corroded contacts. First check the contacts on both the MagSafe connector and on the computer to see if there are any obstructions, since the magnets may pick up odd pieces of metal that might short out the power leads or prevent them from making contact. You might also use a stiff brush to ensure that no dirt has built up in the leads.
For the cabling, while the DC component (that which connects to your computer) is permanently attached to the power supply, the AC component (that which connects to the wall) has the option to use a small plug or an extension cable that Apple provides with the adapter. If you are using one with your setup, try swapping it out for the other to see if you get a working connection. This can be used both to troubleshoot the extension cable, but also to test for better grounding, which can clear up some line noise issues. The small two-prong connector Apple includes with the adapter does not have any grounding connections, but the extension cable does and will provide the internal circuitry with an earth ground, so try using the cable to see if that helps.
The final option for the power supply is its indicator light, which will glow green when supplying power and not charging the battery, and will glow amber when charging the battery. If there are any other colors or behavior such as red lights or blinking lights, then that indicates a problem, even if it's a minor issue. If you are experiencing blinking lights on the power supply, try resetting the system management controller on your computer, which can be done by following the steps in Apple's SMC reset guide.
Additionally, you can try calibrating the battery, which will run it through its full power cycle and have the system properly detect its charge level. To do this, save your work and run the system on the battery until the computer automatically powers down (you can speed up this process by playing a graphics-intensive game, or running the iTunes visualizer to draw more power). Then let the system sit for about 5 to 6 hours to drain as much residual power from the battery as possible, and then plug the system back in and charge it fully.
If the problems still continue after resetting the SMC and calibrating the battery, you can try replacing the battery, the adapter, or have the system serviced.