You should never work in your comfort zone. For example: the kitchen is for eating, the common space is for socializing, the bedroom is for sleeping and so the office is for working.
You need to establish those boundaries early on, because they can quickly become bad habits.
Housemates need to understand that there are boundaries, that you can not be distracted or take on responsibilities such as housework or babysitting children.
It’s important to remember that an outside world does in fact exist.
Ensure the environment won’t distract you. For example, music, seat, temperature, make sure everything can keep you attention to your work.