There could be a few reasons why your iPhone XR is pressing random buttons. One possibility is that the touchscreen is damaged and needs to be repaired or replaced. Another possibility is that there is a software issue causing the problem. If you have recently installed a new app or update, that could be the culprit. Try uninstalling the app or update and see if that fixes the problem. If not, you may need to reset your iPhone to its factory settings.