Hey there katieraeweth,
Thanks for reaching out to the Apple Support Communities.
To get started, since seeing the error have you tried restarting your iPhone? If not, give that a try with the steps shown here: Restart your iPhone - Apple Support
How to restart your iPhone X, 11, 12, 13, or later
1. Press and hold either volume button and the side button until the power-off slider appears.
2. Drag the slider, then wait 30 seconds for your device to turn off. If your device is frozen or unresponsive, force restart your device.
3. To turn your device back on, press and hold the side button (on the right side of your iPhone) until you see the Apple logo.
While restarting may seem like a simple step, it can sometimes help with resolving some unexpected issues like this. If still unable to turn on iCloud Photos after restarting, are you by chance updated to the latest iOS version? If not, then we would recommend updating to the latest iOS version as this can often bring the latest features, security updates, and bug fixes. For more details, and help with updating if needed, check out this next link here: Update your iPhone or iPad - Apple Support
Let us know if that's able to help.
Take care!