Chosen Solution

Charging slot is loose,the charger doesn’t fit in properly and it is not charging my device,how to fix it?

If still under warranty, seek a warranty repair. This sounds like your power connector / usb has been damaged, since on this model it is soldered to the main board it will need to be resoldered, replaced or possibly worse depending on what exactly is damaged. If it is only the charging port you may wish to try a repair yourself, the iphone repair kit sold by ifixit will provide most of the needed tools for opening and exploring but this is not an easy repair, unless you have experience with soldering verysmall connections. There are folks in the businesses section who can help, or find a local shop that is willing to do board level repair. There’s not a guide for your model phone here yet, should you wish to try it yourself, but videos are available online showing what you need to know. Frankly I wouldn’t advise this as a first project, but advice is here if you need it and want to give it a try. Good luck.