The first thing is to check and remove any debris from the charging port on the bottom of your device.
Yes, it could be that simple. With time, lint and dust can form a surprisingly efficient obstacle for Lightning cable to fit properly or make solid electric contact.
Use a wooden or plastic toothpick to clean the port. Do not use conductive or hard materials as they can damage the pins or create a short connection. Break the debris into parts and let it fall off the socket.
More about this issue and other troubleshooting hints at Apple Support.