Make sure you are using the correct charging cable, and that it is not damaged. For example, make sure none of the internal wires are exposed. You can use isopropyl alcohol on a cotton swab to clean the contacts if they appear dirty.

While your phone is plugged in, it shows that the battery is full, or in the process of charging. However, when you unplug it, it either completely turns off, or the battery only lasts for an hour or two, even if you aren't using it heavily.

Make sure your apps and phone operating system are all up-to-date. You can check if your apps need to be updated by checking the Google Play Store. You can check if the operating system needs to be updated by going to your phone’s system page and checking under “About this Phone”.

If the card itself is not the problem, and it is not a software bug, there may be a problem with either the SD/SIM card board or the motherboard. Click the provided links to be taken to the replacement guides.