Screen Time on a Mac
macOS has the most capable built-in tool of any desktop OS for this. For many people Apple's Screen Time is enough; it is worth knowing both what it does and the one move that gets around it.
What Screen Time does
In System Settings → Screen Time you get Downtime (a schedule when only allowed apps work), App Limits (a daily budget per app or category), Always Allowed, and Content & Privacy Restrictions. You can set a separate Screen Time passcode, and with iCloud the limits follow you across your Apple devices.
The bypass
When a limit is reached, macOS offers to ignore it — and if you know the Screen Time passcode, one more tap grants more time. Since on your own Mac you set that passcode, the limit comes down to whether you will stop yourself in the moment, which is the thing it was supposed to decide for you. It is a good nudge and a weak wall.
How One Focus does it
One Focus is the wall rather than the nudge. The limit you set is the limit; lifting it early takes the control password, and an optional linked account lets someone else see that you did — the accountability Screen Time's quiet “Ignore Limit” never gives you.
One Focus is a usage limiter, not a tracker that waits for you to stop yourself. You set a daily limit, a nightly block, or a forced Pomodoro rhythm, and it enforces them: when time is up it covers the screen until the window passes. It is built to resist the moment of weakness it exists for — lifting a limit early takes the control password you set, and there is an optional linked account so someone else can see whether you kept to the limits rather than you alone.
It runs on Windows, macOS, Linux and Android, so the rule is the same on every machine you use. It is free and open source under the MIT licence, which for a program that holds this much power over your own computer is the point: you can read exactly what it does before you trust it with that.
Download One Focus — there is a one-line installer and packages for common Linux distributions; pick your platform in the download section.