try doing a hard restart . please update the phone software , please close all other background app and rsetart the system . for more follow Guide - steps fix to Phone Camera in phone and try to see if this helps to fix the camera
hold the power key and wait for 1 min than let the power key go . now try updating the phone software to fix if it is a bug . close all background programs and for more please follow Guide -Fix Phone Camera Step By Step and i hope this will help you to fix the camera .