Your laptop goes dead and you don't understand why because it's plugged in. The very first thing you should look for is status LEDs. The transformer brick or power adapter usually has a status led on it to show that it's plugged into a good outlet and is functioning. If the laptop power adapter LED is not lit and the cord is firmly seated in both the transformer and the wall outlet, then the AC adapter is probably bad. But troubleshooting most power problems takes a little more effort. Fortunately, it's also common for the failure to be the power cord itself, as I've noted with some Toshiba models. Many HP and Compaq models use ""L"" connectors which are less prone to failure, and Sony and Dell cords seem more robust as well, but it's always a possibility. It seems to me I've seen ""L"" connectors on IBM Thinkpads as well.
If the status LEDs on the laptop blink when you wiggle the power cord or if they can be kept on if you position the cord just right, the failure is either the power cord or the power connector inside the laptop. Of the two, you want the problem to be the power cord because it's much easier to fix. A power cord can look perfectly good (see above) but be broken inside, normally as result of letting it dangle off the back of the laptop when you work on your lap. The length of cable running from the power adapter to the laptop is shielded coaxial cable, with the inner conductor attached to the inner part of the barrel connector and the outer part serving as ground. The actual AC power cord is often detachable from the power adapter and is unlikely to fail as long as it's seated.
Many power cords also include a large choke, probably a ferrite, which I assume is to prevent RF interference generated by the laptop from leaking back onto the cord and turning the length between the laptop and the power adapter into an antenna. Frankly, I just cut them off on a repair if they are close too the barrel connector. It's nice to have a reasonable wire stripper so you can strip the coax in one shot rather than worrying away the sheathing with a cheap tool. You want to take about an inch of the outer sheath off and then twist the braid shield together. Some techs like to preload the braid with solder before tacking it to the power connector, but if there's a tab you can wrap it around first it's not really necessary.
I prefer to buy new connectors than to try to reuse the original for several reasons. First, the original laptop power adapter will have a molded casing on the connector, and the only way to get it off is to hack away a little at a time with a razor. I've done it and effected a repair when I was traveling and had no other choice, but the braided conductor on my Toshiba notebook was soldered directly to the outside of the barrel rather than having its own solder point, like a replacement connector. It's also very difficult to solder factory connectors without melting the insulator unless you have a hot, fine tip iron. I get my replacement connectors at Radio Shack for a buck or so, bring the original for sizing. The inside and outside diameter have to be an exact match, so you might even want to bring your notebook to the store with you.
If you are working with the cord length still attached to the power adapter (transformer), make sure you slide the shell for the new connector onto the cord and faced the right way before you solder on the connector. Otherwise, you'll be faced with doing it all over or just taping the heck out of the connector. The length of the barrel connector that fits into the laptop body is somewhat flexible, too long can work, to short and you may be able to back-off a little on the connector shell. To the left, you can see the inner (yellow) of the laptop power cord soldered to the center tab of the barrel conector, and the braid soldered to the outer tab. If you have a heatshrink gun and tubing you can make a much neater job of it than I'm doing here:-)
Obviously, you don't want the two tabs to touch or it just shorts out, so you can work a little tape around one of the tabs if you are paranoid, but leave room to get the shell on. The shell is actually threaded, as is the connector, so they usually hold together pretty good. Since this particular failure gave me so much grief the first time it happened, I always travel with a spare replacement end for my laptop power cord. While my first replacement is still holding up, should it fail, I can just undo the splice and tape the replacement end on in a matter of minutes. It's unfortunate that so many people buy a new laptop power adapter or even crack their laptop open and start fooling with the inside receptacle when the problem is just the connector on the power cord.

Related Products:

AC Adapter for Dell
AC Adapter for DELTA
AC Adapter for Fujitsu