Is there a way to prevent applications to run, like I can with selfControl to disable opening websites? I want to force myself to focus. 

I use https://selfcontrolapp.com to block websites. How can I block apps? 

Is there a utility app, or a terminal command you know?
Freedom allows you to block apps on desktop, it includes a locked mode that should work if you block the right things, it is a paid app however.