It’s in “Settings”->“Apps”, select you app then, “App battery usage” - When enabled, you can press the text and choose between “Optimised” (‘Optimise based on your usage. recommended for most apps.’) and “Unrestricted” (‘Allow battery usage in background without restrictions. May use more battery.’) - At least that is how it’s organized on the Pixel 8.
Damn their oily hides!!