If your MacBook is not charging then it might be due to a simple issue like improper connection, or it could be due to a complex problem like wrong power settings in SMC. At first you can try the below quick fixes to resolve the issue:
1. Check if the MacBook’s power adapter is properly attached to the power source and MacBook's charging port. Remove it once and re-attach it.
2. The MacBook adapter has three parts: Adapter, removable plug, and cable. Detach everything & clean, if there is any carbon deposit, it will get cleaned.
3. Check the adapter and cable for any physical damage.
4. Make sure that you are using the right charger compatible with your MacBook. Every MacBook model requires its specific charging adapter; else, it won't charge.
5. Make sure your adapter isn't overheating. If the adapter overheats, your Mac will shut the power intake until the adapter cools off.
6. Check the charging port on your MacBook and ensure that there is no dust or dirt in it.
Hope the above fixes will resolve the problem and make your MacBook charging normally. If not, then try the below methods to fix any software related issue:
1. Check the battery of your MacBook.
2. Reset SMC.
3. Update or Reinstall macOS.
Hope the above methods and solutions will help you resolve the issue!