For these kind of problems, tech is not really a solution. So better talk to a registered psychologist or psychiatrist.
But on the tech side, for android users, 'Open TimeLimit' is a useful app. It's like an advanced app locker, with timers and stuff. It's FOSS and on Fdroid:
Edit: Make sure to disable the app when you go out etc. Because it might cause obstacles during emergencies. Depends on the way you set it up of course.
But on the tech side, for android users, 'Open TimeLimit' is a useful app. It's like an advanced app locker, with timers and stuff. It's FOSS and on Fdroid:
https://codeberg.org/timelimit/opentimelimit-android
https://f-droid.org/app/io.timelimit.android.open
Edit: Make sure to disable the app when you go out etc. Because it might cause obstacles during emergencies. Depends on the way you set it up of course.