This is a simple fix.
Your charging port is dirty. Filled with fine dust particles or pocket lint. Basically, the white part of your charger should touch the phone itself. If there is a gap, it'll need to be cleaned. The harder you press, the more compact it becomes. Use a tooth pick to dig at the port. Be careful not to damage on the prongs. These are near the bottom. I don't recommend using a metal pick as it damages the port very easily. Tooth brush can sometimes work as well. Do this and you'll be up and running in no time.