Hi, you can check this link: If your iOS or iPadOS device restarts or displays the Apple logo or a spinning gear unexpectedly
Download the latest iOS software update, go to Settings > General > Software Update.
If the battery's maximum capacity is below 80%, you need to replace the battery. You can go to Settings > Battery > Battery Health.
You may also need to restore your phone as new:
How to back up your iPhone, iPad, and iPod touch
Restore your iPhone, iPad, or iPod to factory settings
If the issue persists, you can take your phone to an Apple Store or Apple Authorized Service provider. You can book an appointment on getsupport.apple.com or use the Apple Support app.