When your iPhone is not charging, check the fundamentals first, it could be a bad cable, adapter or outlet (swich to a different device or a different charger). then cleanse and wipe the point of charge with such a brush, or tooth-point, as will wipe out the lint. Restart the iPhone with force, and use another cable, adapter or wireless charger, where possible. In case it will not charge further, update iOS or look at the warnings of moisture. In cases of continuous problems, attempt charging by connecting it through the computer USB and check whether it will be recognized or not, then probably it is a hardware or a battery problem, then take it to the Apple Support or an Apple Store to fix it.