What worked somewhat okay for me was rooting the phone to edit the hosts file, but this was really cumbersome and left many loopholes that I only found afterwards. Then the root access suddenly disappeared, so I can no longer close these loopholes. I didn't really understand the rooting process (on Samsung Android), it was just patched together from various tutorials, so I can't explain why this happened or how to fix it.
Blocking directly in the router also worked a bit better than other methods, but can be bypassed by switching to mobile internet, and my current router doesn't support it anyway.
If anyone has any suggestions for me, it would be super helpful. So far my last resort would be to get a different phone for which it is easier to acquire root access, but I hope there is a better way.