There are a few guides such as those at iFixit.com for macs and related hardware
but due to the complexity and lack of user-replaceable components in MagSafe
power adapters, the suggestion to purchase quality replacement is recommended.
Also be wary of clones and poorly constructed off-brand unofficial-sourced copies.
For other ideas involving the MagSafe and Apple Portables:
• Apple Portables: Troubleshooting MagSafe adapters - Apple Support
• About Mac notebook batteries - Apple Support
An example of authentic source of Apple MagSafe replacement adapters:
http://eshop.macsales.com/search/magsafe+adapters
iFixit's guide to Apple Adapter repair:
https://www.ifixit.com/Device/Apple_AC_Adapter
Good luck & happy computing! 🙂