Try a Forced Restart on the phone. This is the first thing that the tech will do if you take the phone in to have it checked out.
Follow the instructions very carefully, as this is a bit tricky. (Hint.....ignore the "slider" when it appears and keep holding the Side button in until the Apple logo appears. This might take another 15-20 seconds.)
Force restart iPhone - Apple Support
If a Forced Restart does not help, this almost always indicates a hardware problem.....possibly with the battery.
Make an appointment at the Apple Store or take the phone in to an authorized Apple service shop.
You can find a list of authorized shops in your area using this link: Find Locations