I use Burnout Buddy, it can block both apps and websites, you can set up custom rules, time based, usage based or triggered by Shortcuts (for instance I have one set up to block Reddit when I enter the gym).
Just want to say I was looking for something like this the other day that didn’t feature an obscene subscription and I’m very glad you made me aware of this app. It’s lovely and free!