If your phone restarts or turns off by itself frequently, check the following steps:
1.If problems occur when an application is in use, uninstall it to see if you fixed the issue.
2.Make sure that the problem is not caused by incorrect operations such as mistakenly touch and press the Power Button. And your phone’s buttons might get stuck by phone case.
3.Your phone might restart or turn off by itself when being used in a very cold or hot environment.
4.Take out the SIM card, check if it isn’t damaged or degaussing, then put the card back in and see if you fixed the issue.
5.Plug in your phone and let it charge for 30 minutes, then force restart your phone and see if you fixed the issue.
6.Go to [Settings] > [Additional Settings] > [Automatic on/off] and check if your phone is set up for automatic power off.
7. Go to Phone manager > Click on [One Touch Optimization]
8.Go to [Settings] > [System updates], detect and update your phone to the latest version of ColorOS.
9.Contact realme Support Team, or take your phone, proof of purchase and warranty card to a nearby realme Service Center for repairs.
Source: Realme