Thats not good @A_Google_user
As a process of elimination can you put your phone in Safe Mode.
This will help to determine if an app is causing this.
If it continues in safe mode then clear the phones system cache files.
Clear your System File Cache vai the instructions in the Samsung Link. You may need to hook upto a computer or insert your headphones to get to the recovery menu. https://www.samsung.com/uk/support/mobile-devices/how-do-i-clear-the-cache-on-my-device/
As a last resort back up and factory reset.
A Samsung Experience Store / Samsung Service Centre can take a look at your phone.
Current Phone > Samsung Z Fold³ 5G.
I was lucky enough to still be within the 30 day purchase period so have now changed my handset for a new one.. fingers crossed this ones ok (so far so good)🤞 I tried absolutely everything with the other 1 and nothing worked. It started resetting all my ringtones and other settings back to default everytime it restarted which was really p*ssing me off!
I even messaged Samsung on twitter and they wouldn't acknowledge the issue, even though its well documented in all the forums I've looked in! (Just wish I'd looked in them 1st before buying it!)