Hello! I'm sorry to hear that you're having trouble with your Realme 5. I understand that the operating system is taking up a lot of memory and causing your phone to hang. Here are some suggestions that might help:
1. Clear app cache and data: Go to Settings > Apps > select the app > Storage > Clear Cache/Clear Data. This will free up some space on your phone.
2. Uninstall unused apps: Go to Settings > Apps > select the app > Uninstall. This will remove unused apps and free up some memory.
3. Move apps to SD card: Go to Settings > Apps > select the app > Storage > Change storage location. This will move the app to the SD card and free up some memory.
4. Use lite versions of apps: Some apps have a lite version that uses less memory. You can search for them on the Google Play Store.
5. Turn off animations: Go to Settings > Developer options > Window animation scale/Transition animation scale > select "Animation off". This will make your phone faster and use less memory.
6. Clear system cache: Turn off your phone > Press and hold the Volume Up and Power button > Release the Power button when the Realme logo appears > Release the Volume Up button when the recovery screen appears > Select "Wipe cache partition" > Reboot system now.
If these suggestions don't work, you may need to do a factory reset. But make sure to back up your data first, as this will erase everything on your phone.