Question: how to fix an iphone that is glitching?
Answer: Use the lock button to turn the screen off and on again.
Hold down the Sleep/Wake and Home buttons until you see the Apple logo appear to reset your iPhone.
Factory reset and restore your device as a new phone, or restore it from a backup.