Hi TheDudeBruh,
Thanks for asking the Apple Support Communities about issues with your iPhone. Thanks for also letting us know you are already updated to iOS 16.5.
It sounds like this was a one-time issue since the screenshot worked for Safari.
You might want to check this help article for issues with apps, since the third-party app Uber was open when it restarted: If an app on your iPhone or iPad stops responding, closes unexpectedly, or won’t open
You can also check the troubleshooting here: If your iOS or iPadOS device restarts or displays the Apple logo or a spinning gear unexpectedly
Also, test if the issue was only during the Uber app, or if any apps open cause your deice to restart. If it's only with the Uber app, you may want to ask the developer to check their app.
How to contact an app developer
Cheers!