A clean small brush (such as new childs toothbrush or cosmetic brush
free from debris and unused) should be able to help. There may be
some additional things to try if the tiny pins (spring loaded) are stuck.
The link provided in reply above is a good source of information.
If MagSafe Board (port in the computer) is problematic & nothing
seems to work, inquire into having the 'MacSafe DC-in board'
replaced by an authorized Apple service provider; after inspection.
• About Mac notebook batteries - Apple Support
You may be able to use an iFixit repair guide for Mac to see what
options may be available to you; or use it to look into a possible fix.
• MacBook Repair Guides (older 2006~2010 + newest 2015-2016)
https://www.ifixit.com/Device/MacBook (this is not a Pro or Air series)
Mac Portable Repair guides, including other models:
https://www.ifixit.com/Device/Mac_Laptop
Hopefully you are able to resolve the issue w/o much difficulty.
Good luck & happy computing! 🙂