Assuming you're trying to update your device wirelessly (Settings>General>Software Update), and bearing in mind that to perform such a procedure you need to connect your device to a reliable and fast Wifi Network with Internet access (no cellular data, unless you use a 5G network, no personal hotspot on your device, no VPN connections are admitted, no Low Power Mode enabled, and I suggest that you keep the device plugged into power during the whole update process), read this support article:--> If your iPhone, iPad or iPod touch won’t update (if you don't have a reliable and fast wifi network, "borrow" one from your relatives/friends/neighbors).
Also, make sure your device is NOT running a Beta operating system version. Should be this case, you need to remove it before installing any official iOS/iPadOS releases, as per these instructions:--> How to uninstall iOS or iPadOS beta software - Apple Support.
DO NOT forget to create a full backup of your device before updating its operating system, and keep in mind that, depending on the available storage on your device and/or on your wifi network speed, it might take 30-60 minutes to complete the entire update process.
If the issue persists or if the iOS version currently running on your device is very old (you didn't indicate which iOS version is currently running on your XR), try to update it via computer (if you don't have a computer borrow one from your friends/neighbors, or ask for help at an Apple Store or Authorized Service Provider), then learn how to update your device manually if you're using a Mac with macOS Catalina or later, or if you're using a Mac with macOS Mojave or earlier or a Windows PC.
If you still get no help, contact Apple Support directly, using this link:--> Contact Apple for support and service
Regards
Giulio