Just cut it off when it comes back on let it charge or try shocking it by holding power and home button until it cuts off this usually restarts the phone and sometimes fixes little problem that you may be having
Not sure if this works on all devices but try hold both power and home button until something happens this isn’t referred to as “shocking” basically a way to restart your phone if that don’t work hold all buttons at once and wait till something happens usually takes no more than five to ten seconds