I have a galaxy S6 and when I woke up I tried to charge my phone except it wouldn't work. Later when I tried to turn my phone on it started installing a system update.
If it's actually installing the update, just plug the charger in and let it finish - if you stop it in the middle, unless it's Oreo or Pie, you'll convert the phone into a paperweight.