somewhat simpler but paid (but pricey at $10 month) solution i’ll shill for is Opal. only app i’ve used that can actually lock app, set time limits, etc w a pretty great UI and config setup
I restrict myself from distractions by disabling hosts via custom rules in my nextdns account. It is enough and free.