Chosen Solution

Every time I plug in my iPhone to charge it or unplug it, the screen glitches and than starts restarting itself.

Perhaps maybe get the charging port assembly replaced? Sounds like it’s faulty and causing a short circuit to the phone while plugged in.