Engadget
Why your Roku keeps randomly turning off (and how to fix it)

Roku devices shut down after 20 minutes of inactivity because of an auto-power-saving setting that also turns off the connected TV. The setting can be disabled on Express 4K, Express 4K+, Streaming Stick 4K, Streaming Stick 4K+, Roku 4, Ultra, and Ultra LT by unchecking “After 20 minutes of no interaction” in Settings → Power. If the issue continues, check the power source, HDMI cables, remote batteries, TV power-saving settings, and HDMI-CEC devices. Adjust or disconnect any problematic components to resolve the problem.